I have speech data that I can represent using matlab plot. however, If i want to display it on log scale(like cooledit or Audition), I can take something like

data = audioread(pth);
for j=1:length(data)
    if data(j) >0 
         data(j) = 20*log10(data(j));
         data(j) = 20*log10(abs(data (j)));

problem with this is that zero values map to infinity and negative values map to positive side . I need representation where Y axis would run in db like [0 -3 ..-21..-inf.. -21 -3 0](like in Cooledit) and the data is plotted as per this axis.
How do i do this?


1 Answer 1


It doesn't really make sense to display an instantaneous AC waveform on a log scale - as demonstrated by your results. I googled for cooledit screenshots and found this.

enter image description here

To accomplish this you would want to keep your data linearly scaled and draw it normally. Then just label the axis at the desired dB points.

  • $\begingroup$ It makes perfect sense and it is done in Audacity as it should be. $\endgroup$
    – jojeck
    Oct 16, 2015 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.