Hot answers tagged

4

Since you care about the time it takes, you'll want to use an optimized FFT implementation. That would be FFTw or FFTS, realistically. Historically, FFTw is way dominant in software (I mean, even Matlab uses that), but FFTS works really well on ARM, so might be the better choice for your Pi. Then you'd just write a minimal C++ program that creates an ...


4

Circular convolution is just linear convolution aliased by DFT length $n$. The length of linear convolution of $a$ and $b$ will be $2n-1$. So take $FFTs$ of $a$ and $b$ , padding each of them to length nearest power of 2 more than or equal to $2n-1$. Multiply the corresponding $FFTs$ point by point to get a power of 2 length sequence and take $IFFT$ of it. ...


4

The spectral efficiency of OFDM is strictly worse than that of a pulse-shaped QAM signal with the same rate. OFDM requires a guard interval, on which no useful information is transmitted. It is common to dedicate several subcarriers to pilot signals. It is often not pulse-shaped (or, more accurately, pulse-shaped with a rectangular pulse). Since each non-...


3

I suspect the OP is referring to a frequency offset and not a static time offset. If the 1ppm is a frequency offset of the clock frequency and not a static time offset, this could be introduced with an numerically controlled oscillator (so in Matlab this is simply multiplying the datapath signal by $e^{j\Delta f t}$). If that clock is a reference to other ...


2

The discrete-time Fourier transform (DTFT) is always periodic. This is also the case for the frequency response of the discrete-time Hilbert transformer. For this reason, the ideal frequency response is not only zero at DC but also at Nyquist, which corresponds to index $2$ for a signal of length $4$. Consequently, the correct way to do what you're trying to ...


2

Not really. Welch's method is specifically designed to estimate spectral density and discards phase information. IFT and FT are almost identical and have the exact same complexity. If you want to do an IFT, just do an IFT unless you have a really good reason not to.


2

"Is Windowed FFT called smoothing?" No. "Do I need to do anything else apart from ifft(X_3term(m)) to perform inverse of Xthree−term(m)" No. Here is what is going on: Suppose $$ X[k] = \sum_{n=0}^{N-1} x[n] e^{-i \frac{2\pi}{N} nk } $$ This is the conventional definition of the DFT which is unnormalized. Now do the following with it: $$ \...


2

For your non-real-time application, you do not need OS or OA. Direct form convolution (such as Octave function conv()) is easy and gives the same result. But since the title of your post is "Filter size vs. FFT size and Overlap add", this graphic directly addresses that issue.


2

More specifically, I can't figure out how to extract and apply the time-variant Mag and Phase characteristic of the reverb space. A real acoustic reverb does not have any time variant characteristics. It's an LTI system, at least as long as nothing is moving around in the roon. For example, there's a certain decay time for 100Hz in the space, which means ...


2

First, you have to extract the Room Impulse Response (RIR) of the space from your sine sweep recordings. You can do this by taking the ratio of the FFTs of the measured response and sine sweep input and then taking its IFFT, rir = ifft(fft(measured, Nfft)./fft(sin_sweep,Nfft)). I generally use Nfft = 2^nextpow2(length(measured)) You can truncate the RIR to $...


2

[Pictures to follow] Let us start with a thought experiment (which can be simulated): imagine a constant signal with value $c$. Add a full period of a pure sine with non-zero frequency. If you can remove this harmonic contribution by zeroing out its frequency bin in the Fourier domain, then the resulting inverse Fourier signal will still have mean $c$. So ...


1

The magnitude of the FFT will likely scale by the number of samples N depending on the specific algorithm you use. So the IFFF will be 1/N. Just multiply your FFT bins by N to normalize it. If you use any windowing this will change the result accordingly


1

And as far as I know the real numbers mean magnitudes of each frequency bin, and imaginary numbers mean phase shifh of each frequency bin. No. The magnitude of the complex spectrum $|X(k)|$ means magnitude of each freqency bin, and the phase angle of the complex spectrum $\angle X(k)$ represents phase shift. But then what mean imaginary part of IFFT output?...


1

In general for the FT, in order for the result for the DFT or IDFT to be real, the waveform MUST be real and even (symmetric about vertical axis) or imaginary and odd (anti-symmetric about the vertical axis), or made up of the sum of such components. A simple example with a cosine and continuous-time Fourier Transform as detailed below should clear this up ...


1

(while we expected it to be real). We certainly did not expect this to be real. Quite on the contrary: a real time domain signal has a spectrum that is conjugate symmetric. Be zeroing out the negative frequency we clearly broke this symmetry and that means that the analytical signal MUST be complex (other than the trivial case a $x[n] = const$)


1

You have two signals of length $N = 220500$ and $ L = 8821$ samples long, and you want to obtain their convolution $y[n]$ of length $K = N + L-1 = 229320$ samples long, by using a frequency-domain DFT//FFT method... Then you have to compute $K = N + L -1 = 229320$ sample long FFTs of both signals $x[n]$ and $h[n]$, and then multiply them, and then invert ...


1

I think there is a better way of writing the twiddle factor. Instead of using a different "basis" for each stage, you can use the FFT length as the base for all twiddle factors and the only thing that changes between stages is the step size. Stage 0: $W_{16}^0$ Stage 1: $W_{16}^0, W_{16}^4 $ Stage 2: $W_{16}^0, W_{16}^2,W_{16}^4, W_{16}^6 $ ...


1

You got it mostly backwards, but otherwise OK :) This can be pretty directly answered by writing down what the Cooley-Tukey FFT's twiddle factor $W_N$ is: $$W_N=e^{-i\frac{2\pi}{N}}$$ and that's it. For example, in your picture, in Stage 0, you're multiplying with $W_2^0=\left(e^{-i\frac{2\pi}{N}}\right)^0=e^{-i\frac{2\pi0}{N}}=e^0=1$. So k is the index ...


1

To start with, XAPP1161's developers re-use, for their transmitter and receiver blocks, the objects dsp.ChannelSynthesis and dsp.Channelizer, respectively. These are objects of MATLAB's DSP System Toolbox. The Channel Synthesizer block diagram corresponds to the transmitter block in XAPP1161's Figure 3 Polyphase Filter Bank (page 3), and the Channelizer ...


1

Forward DFT and Inverse DFT are quite similar transforms related by the following: Let $x[n]$ be a length $N$ sequence, $X_f[k]$ be its N-point forward DFT, and $x_i[k]$ be its N-point inverse DFT : (ignore whatever that $k$ or $n$ refers to, let it be just a sequence index.) $$X_f[k] = \text{DFT}\{x[n]\} = \sum_{n=0}^{N-1} x[n] e^{-j\frac{2\pi}{N}nk}$$ $$...


1

Sorry, I didn't read the paper so this is just a guess. FFT and IFFT are almost identical algorithms so it really makes no sense to code up both in an FPGA. Just use $$F^{-1} (x) = F(x')/N, \\ F(x) = N \cdot F^{-1}(x)'$$ where N is the length of the FFT and "'" to conjugate complex operator.


1

The FFT of a non-integer multiple frequency is very complex, you don't want to go there! There are various oscillator schemes that are a few MAC instructions per sample such as https://vicanek.de/articles/QuadOsc.pdf Checkout a review here: https://www.njohnson.co.uk/pdf/drdes/Chap7.pdf


1

No way. You cannot recover a time domain signal from its fundamental frequency. Although, it is not clear what does a plural means here, "the fundamental frequencies and amplitudes", so maybe I am not quite understanding you. Also, the power spectral density (PSD) alone, whether in dB or else, is not sufficient to recover a time domain signal: you ...


1

Sanity check your data layouts. It is very common for FFT libraries to pack the (real-valued) Nyquist-bin into the unused imaginary component of the DC-bin and it happens almost naturally when you implement a real-transform as a half-size complex-transform. As far as I can tell, vDSP wants such "packed" layout, where as Python apparently stores it ...


1

The FFT probably had to be ran on a square image that was padded out, the inverse has returned the padded out image.


1

Choosing the FFT size for optimally efficient fast convolution The result of linear convolution $$ y[n] = \sum\limits_{i=0}^{L-1} h[i] x[n-i] $$ of a block of input, $x[n]$, of length $B$ $$ x[n] = 0 \qquad \text{for } n < 0 \text{ or } n \ge B $$ with a finite impulse response (FIR), $h[n]$, of length $L$ $$ h[n] = 0 \qquad \text{for } n < 0 \text{ or ...


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