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)
Show older comments
yfft=fft(y); % fft of original signal
f=-length(y)/2:length(y)/2-1;
k=20*log10(abs(yfft));
plot(f,k);
0 Comments
Accepted Answer
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.
0 Comments
More Answers (0)
See Also
Categories
Find more on Audio Processing Algorithm Design 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!