How to cut out low frequencies from an audio file signal?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to write a matlab program that can detect what surface is being walked on based on the frequencies in an audio file. The code for reading the file data and plotting it in the frequency domain is as follows:
[data,Fs]=audioread(file_name);
num_samples = length(data);
P = fft(data);
PSD = P.*conj(P)/num_samples;
PSD = PSD /max(PSD);
f = Fs/num_samples*(0:num_samples/2-1);
plot(f,PSD(1:num_samples/2),'r');
xlim([500 15000]);
ylim([0 0.75]);
%find peak
[max_value, index] = max(PSD);
freq = f(index);
% using findpeaks
[PKS,LOCS] = findpeaks(PSD(1:num_samples/2),f,'Threshold',0.5);
[pks2,locs2] = findpeaks(PSD(1:num_samples/2),f,'MinPeakHeight',0.5);

I am trying to cut out the huge spike at the beginning so that the PKS values come from the more meaningful data around the 0.5 area rather than the random low frequency noise from the recording closer to 0.
0 commentaires
Réponses (1)
Navya Seelam
le 6 Déc 2019
Hi,
You can use high pass filter to filter out the low frequencies. Refer to this link to understand designing of high pass filter
0 commentaires
Voir également
Catégories
En savoir plus sur Audio Processing Algorithm Design dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!