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 Ansichten (letzte 30 Tage)
yfft=fft(y); % fft of original signal
f=-length(y)/2:length(y)/2-1;
k=20*log10(abs(yfft));
plot(f,k);

Akzeptierte Antwort

Honglei Chen
Honglei Chen am 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.

Weitere Antworten (0)

Kategorien

Mehr zu Audio Processing Algorithm Design finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by