How to calculate PSD estimate of acoustic data in 1Hz bins? pwelch?
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:Usersdatafolder’);
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!!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:Usersdatafolder’);
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!! 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:Usersdatafolder’);
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!! power spectral density, acoustics, soundscape MATLAB Answers — New Questions