How do I create a frequency waterfall plot from an impulse response?
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Navya Seelam
le 8 Août 2019
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 commentaires
Voir également
Catégories
En savoir plus sur Spectral Measurements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!