Spectrogram calculation issue with power=1
See original GitHub issue🐛 Bug
While this is true when power=2
,
it is summing up real part and imaginary part when power=1
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Problem 1: Implement a function to compute power | Chegg.com
Problem 2: Analyse the effect of window size on the spectrum of different types of audio signals. (1 point) a) Calculate spectrogram with...
Read more >(PDF) Doppler Sensor-Based Blink Duration Estimation by ...
In this paper, we propose a novel Doppler sensor-based blink duration estimation method based on the analysis of eyelids closing and opening ...
Read more >Spectrogram using short-time Fourier transform - MathWorks
Use the spectrogram function to compute the STFT of the signal. Divide the signal into segments, each M = 49 samples long. Specify...
Read more >Encounter 0 when calculating log power spectrum
Convert the magnitude spectrum or power spectrum to db by 20*log10(X(k)) or 10*log10(X(k)**2) , respectively. My problem arises when there is X( ...
Read more >1 FFT and Spectrogram
1 FFT and Spectrogram ... This second interpretation gives rise to the Inverse DFT formula. ... reduce the number of calculations to O(n...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I see, so librosa does
spec_f = spec_f.power(2).sum(-1).sqrt().pow(power)
or, using the new syntax,spec_f = complex_norm(spec_f, power=power)
. We should also check how Kaldi is doing it to make sure we wouldn’t break the compliance interface.So, if
power
is specified, you’d return the power of the magnitude (aka absolute value) of the complex number viaspec_f = spec_f.pow(2).sum(-1).sqrt().pow(power)
?The code currently behaves very closely to L^p norms:
(sum_i |x_i|^p)^{1/p}
even for non-integersp >= 0
. The difference with the code is the absence of absolute value and the p-th root. I would expect this to have been the original intention.|x_0| + |x_1|
as mentioned above – not what the code is doinglen((x,y))
– always 2 for complex numbers – what the code is doingmax(|x_i|)
– not currently supported by the code.Mixing normalization by the L^2 norm (when using
normalized
) with other power is a little strange.normalized
option if it does not interfere with other places).Thoughts?