0
$\begingroup$

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));
    else
         data(j) = 20*log10(abs(data (j)));
    end
end

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?
sedy

$\endgroup$
-1
$\begingroup$

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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