MATLAB音乐

  1. 1 准备软件
  2. 2
  3. 3

老坑新填:)

1 准备软件

MATLAB软件任意版本。支持sound函数即可。

关于sound函数:(此介绍来源于MATLAB 2018a帮助文件)

sound

Convert matrix of signal data to soundcollapse all in page

sound(y)
sound(y,Fs)
sound(y,Fs,nBits)

Description
sound(y) sends audio signal y to the speaker at the default sample rate of 8192 hertz.
sound(y,Fs) sends audio signal y to the speaker at sample rate Fs.
sound(y,Fs,nBits) uses nBits bits per sample for audio signal y.

y — Audio data
column vector | m-by-2 matrix
Audio data, specified as an m-by-1 column vector for single-channel (mono) audio, or an m-by-2 matrix for stereo playback, where m is the number of audio samples. If y is an m-by-2 matrix, then the first column corresponds to the left channel, and the second column corresponds to the right channel. Stereo playback is available only if your system supports it.
Data Types: double

Fs — Sample rate
8192 (default) | positive number
Sample rate, in hertz, of audio data y, is specified as a positive number from 1000 through 384000. Valid values depend on both the sample rates permitted by MATLAB® and the specific audio hardware on your system. MATLAB has a hard restriction of 1000 Hz <= Fs <= 384000 Hz, although further hardware-dependent restrictions apply.
Data Types: single | double

nBits — Bit depth of sample values
16 (default) | 8 | 24
Bit depth of the sample values, specified as an integer. Valid values depend on the audio hardware installed. Most platforms support bit depths of 8 bits or 16 bits.

2

3


Do sth I like.


这篇博文参考了以下文章:
123
感谢他们的分享。