How do I present an audio signal in a time domain plot using MATLAB, such that the y-axis is in decibel (dB) instead of of a linear scale?
33 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kwaku Owusu
el 14 de En. de 2021
Editada: street_car
el 18 de Jun. de 2021
Please, I have a recorded audio signal from experimental work. I have been able to plot the time domain graph (see attached) using Matlab software. By default, the y-axis values are present in a linear scale (Amplitude). I would like to plot the time domain graph such that the y-axis scale is is in decibel. I understand that using 20*log10(signal/ref. signal) should provide the decibel scale on the y-axis, however, this does not seem to work after several attempts.
** My code**
Let say the signa name is TD, so I use the code plot(20*log10(TD/20*10^-6)), the 20*10^-6 is my reference air pressure. The problem is that the entire signal is distorted.
Please, I would be glad if someone can assist me (specifically with a code in matlab to visualise the signal). I might not be doing something right. Thank you.
Thank you.
6 comentarios
Mathieu NOE
el 15 de En. de 2021
hello
do not forget to take the abs of your time data before doing the 20*log10 action
spl = 20*log10(abs(TD/20*10^-6))
maybe some smoothing may be needed (=> movmean)
make sure that TD signal unit is Pascals
Respuesta aceptada
dpb
el 15 de En. de 2021
Editada: dpb
el 15 de En. de 2021
See the attached link https://www.dsprelated.com/freebooks/mdft/Decibels.html
In particular, note that "Signal intensity, power, and energy are always proportional to the square of the signal amplitude.power". When you just use a zero-mean time trace, the log10 is undefined for values <=0 which is what is happening with what you've tried so far.
Más respuestas (1)
street_car
el 18 de Jun. de 2021
Editada: street_car
el 18 de Jun. de 2021
Can the waveform be plotted in MATLAB like how Adobe Audition does? See attached.
The waveform is still plotted with linear sample values (hence the positive and negative values), but the display is cleverly adjusted to reflect what the dB value would be at that point. I'm not sure if anything like this is possible in MATLAB. In audition, you can switch to linear samples for the Y-axis, and the waveform and scale would remain unchanged. So, I'm sure that Adobe has just come up with a way to overlay/display what the corresponding dB value would've been if we took the 20*log10 of the amplitude samples.
0 comentarios
Ver también
Categorías
Más información sobre Multirate Signal Processing 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!