How to calculate the frequency response (spectrum) of each impulse response?

8 views (last 30 days)
Dear all,
For an exercise we loaded two wave audio files, and plotted them:
[y1,fs1]=audioread('imp_narrow.wav');
[y2,fs2]=audioread('imp_wide.wav');
t1=0:1/fs1:(length(y1)-1)/fs1;
t2=0:1/fs2:(length(y2)-1)/fs2;
plot(t1,y1,'color','m');
hold on;
plot(t2,y2,'color','g');
title('Two signals')
ylabel('Amplitude (Pa)')
xlabel('Time (sec)')
Now we need to calculate the frequency response (spectrum) of each impulse response. Can anyone help us?
Thank you in advance!

Answers (1)

karala rajesh
karala rajesh on 20 May 2019
[y1,fs1]=audioread('imp_narrow.wav');
[y2,fs2]=audioread('imp_wide.wav');
t1=0:1/fs1:(length(y1)-1)/fs1;
t2=0:1/fs2:(length(y2)-1)/fs2;
plot(t1,y1,'color','m');
hold on;
plot(t2,y2,'color','g');
title('Two signals')
ylabel('Amplitude (Pa)')
xlabel('Time (sec)')

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!