Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
Björn Bents
Björn Bents el 17 de Ag. de 2021
Comentada: Justin el 29 de Oct. de 2022
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])

Respuestas (1)

jibrahim
jibrahim el 18 de Ag. de 2021
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])

Categorías

Más información sobre Simulation, Tuning, and Visualization en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by