Dear all,
I tried to explain as clear as possible. I want to plot "Raw FFT" file for a "WAV" file. This WAV (audio) file is acquired from a microphone for a period of 1 minute. The goal is to plot frequency distribution (0 Hz – 20 kHz).
- I want to acquire raw FFT (to see if there are any signal peaks at particular frequency) throughout 1 minute. The WAV (audio) file (only 1) is atttached to this question.
- Please help me with the code and the output graph.
I tried to execute the following code (from previous answers here) and I think it is not the right way. I think what the code shows is basically amplitude vs frequency; but not a typical FFT spectrum.
Million Thanks,
Avinash.
CODE: I tried and most likely wrong. I think as said, it is just amp vs freq, which does not give me clear picture of frequencies which lies in different ranges.
[y1,fs]=audioread('myWAVaudiofile.wav'); t=linspace(0,length(y1)/fs,length(y1)); Nfft=16777216; %power of 2 and I put a huge number so there are many data points
f=linspace(0,fs,Nfft); X1=abs(fft(y1,Nfft)); plot(f(1:Nfft/2),X1(1:Nfft/2)) xlabel('Frequency'); ylabel ('Power???'); title ('FFT Spectrum');
OUTPUT: I only zoomed into 0-30 Hz using above code and WAV file attached (ofcourse the wole spectrum is until 20000 Hz)
Best Answer