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 vues (au cours des 30 derniers jours)
yfft=fft(y); % fft of original signal
f=-length(y)/2:length(y)/2-1;
k=20*log10(abs(yfft));
plot(f,k);

Réponse acceptée

Honglei Chen
Honglei Chen le 25 Avr 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.

Plus de réponses (0)

Catégories

En savoir plus sur Audio Processing Algorithm Design dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by