Sound Pressure level returning -inf

조회 수: 8 (최근 30일)
Farid
Farid 2022년 9월 1일
답변: Jimmy Lapierre 2022년 9월 7일
Hello Community;
when I use the function [Lt,Leq,Lpeak,Lmax] = SPL(recording_vector) it returns vectors containing (partially or completely) -inf values. Surprisingly when I re-Run the same line I get usual numeric values. how is this possible? how to avoid it?
Thanks
  댓글 수: 2
Chunru
Chunru 2022년 9월 2일
Can you show your data (a portion) or your code?
It is likely due to the signal amplitude to be 0 so log of it becomes -inf.
Farid
Farid 2022년 9월 3일
Thanks a Lot Chunru, I am attaching the file to this comment.
calib=importdata('calib.mat')
IRS=importdata('IRS.mat')
spl = splMeter("CalibrationFactor",calib, ...
"FrequencyWeighting","Z-weighting", ...
"TimeWeighting","Fast", ...
"TimeInterval",0.125, ...
"SampleRate",FS,...
"Bandwidth","1 octave");
[Lt,Leq,Lpeak,Lmax] = spl(IRS)

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

채택된 답변

Jimmy Lapierre
Jimmy Lapierre 2022년 9월 7일
Leq, Lpeak and Lmax are only computed every TimeInterval, so they correspond to the SPL of zero for the first 0.125 seconds. And as chunru said, that corresponds to -Inf. When you call spl a second time, you are already pass the first 0.125 seconds of pure silence.
To avoid it, either discard the fist 0.125 seconds, or set a minimum value you prefer.
For example set any value below -100 dB (including -Inf) to -100:
Leq(Leq<-100)=-100;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio Processing Algorithm Design에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by