Is there a possibility to scale the x-axis of the splMeter Window?

조회 수: 1(최근 30일)
Björn Bents
Björn Bents 2021년 8월 17일
답변: jibrahim 2021년 8월 18일
Hey guys,
for a scintific thesis, I work on a project to analyse acoustic signals. I calculate much acoustic parameters and know i try to calculate the SPL from a .wav Data. I record it with a sample rate of 44.1kHz and i used the splMeter function to get a view on the SPL. My problem is the scale of the SPLWindow. I cant set it to x=0. Now the smallest x-value is about 28,8sec. So i miss the shape of 24 seconds from the SPL.
The yellow graph show the Lt- time weighted sound level (dB). The other graphs a not that important.
I also tried to search on MathWorks for other solutions but I cant find any. You can find the code i used below. The .wav data is also in the attachments to see.
Another short question: Is there another option to calculate the SPL from a .wav data?
Thanks for your help!<3
audFileName = '252_222oS.wav';
scope = timescope('SampleRate',44100,...
'TimeSpanSource','property',...
'YLimits',[20 110], 'AxesScaling','auto',...
'ChannelNames',...
{'LAF', 'LAeq', 'LApeak', 'LAmax'});
SPL = splMeter('TimeWeighting', 'Fast',...
'FrequencyWeighting', 'A-weighting',...
'SampleRate', 44100, ...
'TimeInterval',2,...
'CalibrationFactor',1);
x = audioread(audFileName);
[LAF,LAeq,LApeak,LAmax] = sm(x(:,1));
scope([LAF,LAeq,LApeak,LAmax])

답변(1개)

jibrahim
jibrahim 2021년 8월 18일
Hi Bjorn,
I noticed that you set TimeSpanSource to true on the scope, but did not change the actual time span value. Maybe that's the issue?
audFileName = '252_222oS.wav';
[x,fs] = audioread(audFileName);
SPL = splMeter('TimeWeighting', 'Fast',...
'FrequencyWeighting', 'A-weighting',...
'SampleRate', fs, ...
'TimeInterval',2,...
'CalibrationFactor',1);
scope = timescope('SampleRate',fs,...
'TimeSpanSource','property',...
'TimeSpan',size(x,1)/fs,...
'YLimits',[20 110], 'AxesScaling','auto',...
'BufferLength',size(x,1)*4,...
'ChannelNames',...
{'LAF', 'LAeq', 'LApeak', 'LAmax'});
[LAF,LAeq,LApeak,LAmax] = SPL(x(:,1));
scope([LAF,LAeq,LApeak,LAmax])

Community Treasure Hunt

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

Start Hunting!

Translated by