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?
spectrum
from the library called Essentia that I used to calculate the magnitude spectrum. $\endgroup$log
ofX(k)
is essential in the field of signal processing, e.g, MFCC. $\endgroup$