To convert power spectrum to a log-scaled one, how to define log10(X(k)) if X(k)=0 for some k?
For sake of illustration, I brief my process as follows which is a convention one:
Calculate the magnitude spectrum
X(k)of the time-domain signalx(n)byX(k) = abs(fft(x(n))).Convert the magnitude spectrum or power spectrum to db by
20*log10(X(k))or10*log10(X(k)**2), respectively.
My problem arises when there is X(k)=0 when computing log10(X(k)) which is either not defined or -inf. How to deal with this?
spectrumfrom the library called Essentia that I used to calculate the magnitude spectrum. – Fred Aug 03 '15 at 07:22logofX(k)is essential in the field of signal processing, e.g, MFCC. – Fred Aug 03 '15 at 07:2910*log10(X(k))for each frame (spectrum) in the spectrogram and obtain a curve of energy or loudnessE(n), wherenis the frame index. From which I calculate the standard deviation and set the threshold as2*stdaway frommean. That is, frames with loudnessE(n_i) = sum(10*log10(X(k)))lower thanmean(E(n))-2*std(E(n))will be removed. So-infwill result in unreasonable threshold value. – Fred Aug 03 '15 at 08:36