How to cut out low frequencies from an audio file signal?

3 views (last 30 days)
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);
rec42.PNG
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.

Answers (1)

Navya Seelam
Navya Seelam on 6 Dec 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

Categories

Find more on Audio I/O and Waveform Generation 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!