i want frequency domain spectrum of an audio file but i am not getting right frequency range. it is showing freq. range upto 100 kHz but i want to get it upto 10 kHz. what is the problem in frequency range?

3 views (last 30 days)
yfft=fft(y); % fft of original signal
f=-length(y)/2:length(y)/2-1;
k=20*log10(abs(yfft));
plot(f,k);

Accepted Answer

Honglei Chen
Honglei Chen on 25 Apr 2013
Your f is incorrect, assuming the number of elements in y is even, it should be
N = length(y);
f = (-1/2:1/N:1/2-1/N)*fs;
where fs is the sample rate. Whether it maps to 10 kHz or not depends on your sample rate.

More Answers (0)

Categories

Find more on Audio Processing Algorithm Design in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!