How do I create a frequency waterfall plot from an impulse response?

20 ビュー (過去 30 日間)
Braedon Hall
Braedon Hall 2019 年 8 月 5 日
回答済み: Navya Seelam 2019 年 8 月 8 日
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))

回答 (1 件)

Navya Seelam
Navya Seelam 2019 年 8 月 8 日
Use waterfall function to obtain waterfall plot.
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.

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by