Finding frequency and duration of an audio signal
9 ビュー (過去 30 日間)
古いコメントを表示
What is the frequency (not the sampling rate) and duration of this audio?
>> fs=24000.0; % Sampling rate
>> t=0:1/fs:1; % One sample each Ts=1/fs
>> x=cos(2∗pi∗1000∗t);
>> sound(x,fs);
I'm trying to learn signal processing ... and I can't find the answer to this question anywhere.
Thanks in advance.
0 件のコメント
採用された回答
Star Strider
2019 年 10 月 12 日
編集済み: Star Strider
2019 年 10 月 12 日
You specified it to be 1 kHz, and 1 second duration, so it is just that:
fs=24000.0; % Sampling rate
t=0:1/fs:1; % One sample each Ts=1/fs
x=cos(2*pi*1000*t);
sound(x,fs);
L = numel(t);
fn = fs/2;
FTx = fft(x)/L;
Fv = linspace(0, 1, fix(L/2)+1)*fn;
Iv = 1:numel(Fv);
figure
plot(Fv, abs(FTx(Iv))*2)
grid
xlim([0 2000])
The Fourier transform plot demonstrates it.
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Signal Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!