How to cut out low frequencies from an audio file signal?
조회 수: 4 (최근 30일)
이전 댓글 표시
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
답변 (1개)
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio Processing Algorithm Design에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!