# MATLAB to find individual frequency from a source

24 views (last 30 days)
Audrey on 28 Apr 2014
Answered: Roberto on 28 Apr 2014
I am a beginner in MATLAB and have a .wav file recorded a mixture of sound. Currently I am able to do simple stuffs like plotting a graph in time and freq domain. Through the code, i was able to find the fs is 44100, 16 bits and time is from the input data. However, I do not know how I can find or isolate the frequencies in .wav file to find the source in the mixture. I saw examples whereby they have the original tone/sound and using that frequency to find the different frequencies in the mixture of sound. I do not have any reference to compare with except for having to derive from the .wav file. Any kind souls who can guide me on how to find out each individual frequencies from a mixture. Thank you.

Roberto on 28 Apr 2014
Here's something i wrote time ago...
sampleRate = 44100 ; % findout your samplerate
[n, ~] = size(y) ;
Yy = fft(y) ;
Pot = Yy .* conj(Yy) / n;
Freq = (sampleRate / n *(1:n))';
plot(Freq(1:round(n/2)) , Pot(1:round(n/2)) );