MATLAB Answers

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

조회 수: 4(최근 30일)
Evan Woodard
Evan Woodard 3 Dec 2019
답변: Navya Seelam 6 Dec 2019
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.

  댓글 수: 0

로그인 to comment.

답변(1개)

Navya Seelam
Navya Seelam 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

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by