필터 지우기
필터 지우기

How to calculate PSD estimate of acoustic data in 1Hz bins? pwelch?

조회 수: 18 (최근 30일)
Louise Wilson
Louise Wilson 2019년 7월 26일
댓글: Louise Wilson 2024년 6월 27일 12:44
Hi everyone,
I have several files of 118.5 second duration that I would like to calculate the PSD of. I want to do this in 1Hz frequency bins, with Hanning window and 50% overlap, and have considered using pwelch.
First I calibrate the data and then have tried to work out how to use pwelch to no avail so far:
path=('C:\Users\datafolder');
d=dir(fullfile(path, '*.wav')); %list all .wav files in path folder
files=length(d); %number of files in folder
for i=1:files %for each file
disp(d(i).name);
filename=fullfile(path, d(i).name); %get full filename
[xbit, fs]=audioread(filename); %and then sampled data and sampling
%freq (fs) from audioread function
cal=-176.2;
cal=power(10, cal/20); %calibration correction factor
calxbit=xbit*cal; %apply calibration
end
[pxx,f]=pwelch(calxbit, window, 0.5, [], 144e3);
How do I specify that I want to use 1Hz bins? My data is sampled at 144kHz.
Thanks!!
  댓글 수: 4
Louise Wilson
Louise Wilson 2024년 6월 27일 12:41
Thanks @Mathieu NOE - that is indeed what I did in the end. It takes a long time but is the resolution I need. I also applied the calibration factor on pxx, by converting pxx to dB. :)
Louise Wilson
Louise Wilson 2024년 6월 27일 12:44
Thanks @Michael Ladegaard - sorry, I did not realise your comment was also recent :). In the end I did account for the three points you mention, but I am sure your solution is more elegant! I will refer back to it. Thanks a lot :)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by