How do I create a frequency waterfall plot from an impulse response?
20 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I am using the following code to plot magnitude from an impulse response. I would like to plot a waterfall showing amplitude over frequency over time, but I can't seem to make it work.
If anyone could suggest a solution that would be incredibly helpful.
Thanks
info = audioinfo('IR.wav');
Fs = 44100;
[y,Fs] = audioread('IR.wav');
t = 0:seconds(1/Fs):seconds(info.Duration);
t = t(1:end-1);
NFFT = length(y);
Y = fft(y,NFFT);
Fy = ((0:1/NFFT:1-1/NFFT)*Fs).';
magnitude = abs(Y);
dB_mag=mag2db(magnitude);
figure(1)
plot(Fy(1:NFFT/2),dB_mag(1:NFFT/2))
0 件のコメント
回答 (1 件)
Navya Seelam
2019 年 8 月 8 日
t=0:1/Fs:info.Duration;
t= t(1:end-1)';
Z=[dB_mag(1:NFFT/2) Fy(1:NFFT/2) t1(1:NFFT/2)];
waterfall(Z)
However, the magnitude obtained from fft corresponds to a particular frequency and does not have any time stamp. So, the magnitude obtained from fft can be used to visualize amplitude over frequency but not amplitude over time or frequency over time.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spectral Measurements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!