14

All three transforms are inner product transforms, meaning the output is the inner product of a family of basis functions with a signal. The parametrization and form of the basis functions determine the properties of the transforms.The number of basis functions for a complete picture (i.e. a result that contains enough information to reconstruct the original ...


9

If you really insist on using FFT (rather than parametric methods, which wouldn't suffer from time/frequency trade-offs), you can fake a much better resolution by using the phase information to recover the instantaneous frequency for each FFT bin. Partials can then be detected by looking for plateaus in the function giving instantaneous frequency as a ...


7

Your question is tricky because it is hard to define what "discarding the phase information" means without specifying a practical way of doing it; but then we encounter problems/artifacts which are specific to this particular method. Since you mentioned STFT, let us assume phase information is suppressed by doing a STFT, keeping the magnitudes, setting to 0 ...


7

We always want to apply some kind of a window function in order to minimize the effect of leakage. This makes rectangular window (lack of any windowing) case never used, this is why: Any tapering function used is almost always decreasing to zero at boundaries. This is why we are losing some data. In order to retrieve that somehow you will usually do 50% of ...


7

Definitely you will have to calibrate your system. You need to know what is the relationship between dBFS (Decibel Full-Scale) and dB scale you want to measure. In case of digital microphones, you will find sensitivity given in dBFS. This corresponds to dBFS level, given 94 dB SPL (Sound Pressure Level). For example this microphone for input $94 \;\mathrm{...


6

As pichenettes already pointed out in a comment above, one approach is to use the Goertzel algorithm. However, it is a somewhat common misconception that in order to deduce the amplitude of various frequency bands in a signal, one must use Fourier-transform-based techniques. There are other methods that may be more appropriate to your application. In your ...


6

Simply speaking both the const-Q-transform and the Gabor-Morlet wavelet-transform are just continuous wavelet transforms. Or, more precisely, approximations thereof, as there will always be discretization issues in real applications. A property of wavelet transforms is that they have build in the constant Q-factor property, or in other words logarithmic ...


6

Please refer to this paper on the optimum overlap percentage for the Blackman-Harris window, which is derived to be 66.1%. It has a lot of useful information on spectral analysis and windows.


5

You don't HAVE to zero pad, ever, unless there are constraints on the length of data required by the FFT algorithm - often it's a case of speed. Many FFT's (like the Numerical Recipes code) require a power-of-two length series, some (like Kiss-FFT) only require it to be an even number, but being a multiple of 2,3 and 5 makes it run much faster. In Matlab'...


5

In general, shorter windows contain less information, and will thus provide less frequency resolution. But short windows will be more localized in time, and thus a sequence of short windows might allow greater resolution in locating or separating time domain behavior. Longer windows will contain more information, but this information will be averaged ...


5

This is a rather general answer : I would say that, although each window function has specific characteristics that make it more or less suitable for specific situations, in this context you're not going to see a huge difference in the STFT of a windowed speech signal. In particular, the two windows that you're comparing are quite similar, so I'd expect ...


5

Since the input signal is real, half of the FFT data is "useless" because it is simply the complex conjugate of the other half. More precisely, a 256-long FFT of a real signal will give you: the DC amplitude, 127 amplitudes, the amplitude at Nyquist, and 127 conjugate amplitudes. Among the 700 chunks, 256 / 32 - 1 = 7 extend outside the boundaries of the ...


5

The first-order difference operation is a technique for numerical differentiation. It is the simplest method that I know of, and consists of just treating a discrete-time signal as piecewise linear between each pair of points and calculating the slope between them. The idea is that this time series of slopes should approximate the time derivative of the ...


5

I understand the concept of the STFT. In order to avoid spectral leakage, you use a hann window that overlaps by 50%. I'm sorry but you have a misunderstanding of spectral leakage in addition to how a spectogram should be computed. To be exact you cannot avoid spectral leakage completely; all you can do is to make a compromise between the spectral ...


5

I'm wondering why the STFT pops out. To me, wouldn't a simple threshold on the signal itself or on its envelope do better / just as well, after removal of the g offset? Once you decide what "measure" is best to detect your event, you can apply the work of Basseville and Nikiforov, that I answered here. The classic reference for that problem is ...


5

If this graphics represents the most typical application scenario, then I would go for some simple short window variance estimation and perform thresholding afterwards; $$ \sigma_x^2 = \frac{1}{N} \sum_{n=0}^{N-1} x_{ac}[n]^2$$ Where $x_{ac}[n]$ is the DC removed input signal; i.e., $x_{ac}[n] = x[n] - \bar{x}[n]$ where $\bar{x}[n]$ is the DC (mean) value ...


5

I did answer a similar question a few years back, but can't find it. Basically, you are losing the energy because of the windowing. It's true to say that you should multiply the spectra by 2 in order to retrieve the energy from negative frequencies and divide it by the window size. However, this is only true for the rectangular window. The correct ...


4

I am going to break down this answer into two main parts, one for a step-by-step computation of the STFT, and the other in regards to how to compute the MFCC's, once you have the STFT. STFT: Let us say you wanted to compute the STFT of your signal $x[n]$, of total length $N=100$, and block size $M = 10$, with $50$% overlap, and using a hamming window. I ...


4

The short-time Fourier transform is generally a redundant transformation, usually implemented with the same subsampling over every frequency. If the window is well chosen, it is complete: you can invert it and recover any initial signal. Since it is redundant and complete, it has many perfect inverses. It can be implemented and understood using more ...


4

Edit: I have recently created two Jupyter Notebooks that illustrate this behaviour and let you play around with some actual matrices and actual signals. I find understanding MDCT easiest if we define our transforms as matrix operations. DFT In case of a DFT such a matrix would look like $$ F_M = \left( \sqrt{\frac{1}{M}} e^{-2 \pi i k n / M} \right)_{k,n=...


4

A vocoder is a type of synthesizer originally developed for speech (or the human voice, thus the "vo" prefix), even before the use of digital processors. The Bell Labs Voder was demonstrated in 1939, and VoCoders were reportedly used for encrypted voice communication during WW2 (according to Wikipedia). DFTs can be used to analyze which audio spectrum ...


4

The short-time Fourier transform (STFT) refers to the time-frequency representation of a signal, which is given by: $$X(\tau,\omega) = \int_{-\infty}^{\infty}x(t)w(t-\tau)e^{-j\omega t} \, dt$$ which is equivalent to: $$ x(t)w(t-\tau) = \tfrac{1}{2\pi}\int_{-\infty}^{\infty} X(\tau,\omega) e^{+j\omega t} \, d \omega $$ If the window is scaled so that: $$...


4

The default parameters of signal.spectrogram are: nperseg = 256 noverlap = nperseg/8 = 32 This means that: The length of analysis window is $256$ samples ($256/250 = 1.024$ second) The overlap between consecutive windows is $32$ samples ($32/250 = 0.128$ second) The timestamps returned by signal.spectrogram correspond to the centres of a window. So in ...


4

In Chapter 2.4 Previous Work of The Short Time Fourier Transform and Local Signals, S. Okamura, 2011, one reads: The STFT is also known under many names such as the windowed Fourier Transform, the Gabor transform, and the local Fourier transform. Later, one discovers that the definition may slightly vary with different authors, but, at first glance, ...


4

Real/imaginary or modulus/phase are two representations of a complex number that carry the same level of information. Then, a STFT is a redundant mapping from a space of functions over a 1D variable (time) onto a space of functions over a 2D variable (time and frequency). Under mild conditions on the window, there are an infinity of inverses, due to the ...


4

With all due caution, no in both cases (title and body question). I'll start with the second one. Continuous wavelets use all dilations of the mother wavelet, which are not accessed with the STFT The STFT is complex in general, and the windowed sine is not. For the first one: I never tried it, and do not remember having seen it in use, and one should ...


3

The reason you need overlap add / overlap save for filtering with the short time Fourier transform is basically, that the basis functions associated with the coefficients that you get are are defined over a certain time range (as opposed to a single point in time). The Fourier transform you use to calculate the expansion coefficients also implements ...


3

The least-squares re-synthesis procedure is very similar to the overlap-add (OLA) procedure. Let w_n be the discrete window vector and y_n(:,k) be the time domain vector computed using the IFFT on a column k of the 2D matrix. Both w_n and y_n(:,k) are the same length. Then, using Matlab syntax, we compute the point-by-point multiplication with the window: ...


3

At least 2 effects: transients will be smeared and any frequency content that is between FFT bin centers (not periodic in the STFT aperture length) will be distorted. If you just happened to pick a note that was exactly periodic in the STFT window, then the latter effect might or might not not occur, depending on any slight inharmonicities in the overtone ...


3

I tried my best but I couldn't find a resource that would list the "good" overlap factors for common and less common windows. Here's a list of window functions and overlap factors that have constant overlap-add (COLA). (Code here) Heinzel - Spectrum and spectral density estimation... shows several windows and lists their "optimum overlap" and their "...


Only top voted, non community-wiki answers of a minimum length are eligible