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

7 ビュー (過去 30 日間)
Evan Woodard
Evan Woodard 2019 年 12 月 3 日
回答済み: Navya Seelam 2019 年 12 月 6 日
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.

回答 (1 件)

Navya Seelam
Navya Seelam 2019 年 12 月 6 日
Hi,
You can use high pass filter to filter out the low frequencies. Refer to this link to understand designing of high pass filter

カテゴリ

Help Center および File ExchangeSmoothing and Denoising についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by