Questions tagged [dft]

Discrete Fourier transform (DFT) is a specific kind of discrete transform, used in Fourier analysis.

Given a sequence of N samples f(n), indexed by n = 0..N-1, the discrete Fourier transform (DFT) is defined as F(k), where k=0..N-1:

Enter image description here

Source: engineeringproductivitytools

428 questions
1
vote
1 answer

Image compression with FFT causes patchy areas

I am trying to implement image compression using fft. I follow these steps: Pad the height and weight of the input image to be powers of two (for easier DFT application) For each of the red, green and blue channels: Transform each row to its…
Mushegh
  • 119
  • 4
1
vote
0 answers

Fastest DFT method for Javascript?

I'm working on a "studio" website where you can perform different sound edits on a clip of audio you record. In order to do the sound editing, Fourier Transforms have to be performed on windows of the recorded sound. This is the code for recording…
1
vote
0 answers

Way to calculate vibration

I am reading a paper about synthesis. One of the parts is talking about calculating vibrato, and I want to follow their way to do the same thing. However, I am new to signal processing and am not sure whether the method I found is correct or…
Megan
  • 541
  • 1
  • 3
  • 14
1
vote
1 answer

What causes these periodic spikes when computing Fourier Transform from scratch?

I recently wrote a little python program to compute a fourier transform of a signal from the basics for the sake of learning and checking my understanding of how this function works: import numpy as np from scipy import integrate import…
1
vote
1 answer

fft of a constant function in python

I want to calculate the DFT(FFT) of a constant signal. Here is the code import matplotlib.pyplot as plt import numpy as np from scipy.fftpack import fft, ifft def constant_function(x): return 1 t = np.arange(0.0,1,0.1) print(type(t1)) print(…
Gunners
  • 55
  • 5
1
vote
1 answer

Why is the Number of Frequency Bins Determined by the Frame Size in the DFT?

I'm currently working with Fourier transforms and I notice that the output of an FFT usually has the dimensions (n_fft, ) where n_fft is the number of samples to consider in the FFT, though some implementations discard frequency bins above the…
AlePouroullis
  • 333
  • 2
  • 12
1
vote
1 answer

How to plot the result of 1D DFT on an image with sinus gratings when it only shows completely dark image instead

I have been playing around a little bit to understand how the 2D DFT works. As far as my understanding goes the 2D-DFT performs a columns wise fft and then a row wise fft afterwards. So now I wanted to check what the result looks like after…
OuttaSpaceTime
  • 710
  • 10
  • 24
1
vote
1 answer

How to code the discrete Fourier transform in python

[I am having trouble coding this in Python, I don't really know where to start. The DFT Version 3 is the one pasted below][1] ![1]: https://i.stack.imgur.com/0J7T0.png ![1]: https://i.stack.imgur.com/JXR4i.png
1
vote
2 answers

How can I transfer a discrete set of data into the frequency domain and back (preferrably losslessly)

I would like to take an array of bytes of roughly size 70-80k and transform them from the time domain to the frequency domain (probably using a DFT). I have been following wiki and gotten this code so far. for (int k = 0; k < windows.length; k++) { …
Matt
  • 5,404
  • 3
  • 27
  • 39
1
vote
0 answers

2D FFT convolution or 1D?

For my research, I have a lot of different images A, which I want to convolve with kernel B as fast as possible. The images are (M x N) and the kernel (M x P), in the normal convolution (which I have implemented right now) I slide them over each…
Taliebram
  • 91
  • 6
1
vote
0 answers

Simple Windowing DFT code -ValueError: setting an array element with a sequence

I was expecting to make simple code windowing DFT for my assignment but, i thing i have problem with formating DFT signal realX[k] and imj[k]. Here is my code below: import numpy as np import matplotlib.pyplot as plt import random realX =…
zief26
  • 19
  • 2
1
vote
0 answers

Inverse Discrete Fourier Transform

I have been attempting to implement a Inverse DFT (without using a FFT), but struggle a bit with the maths. From the implementations and pseudo codes I have read I cannot figure out the issue with my…
1
vote
1 answer

R: Inverse fft() to confirm my manual DFT algorithm inaccurate?

Using R, before assessing some metric of accuracy on my own manual implementation of DFT, I wanted to do a sanity check on how well stats::fft() performs by doing the following: sig.ts = ts( sin(2*pi*freq1*t) + sin(2*pi*freq2*t) ); sig.rt =…
Christian
  • 13
  • 1
  • 4
1
vote
0 answers

STFT(Short-Time Fourier Transform) & DFT(or FFT) in Matlab

I want to try STFT & FFT using Matlab. What I wonder is STFT of signal computes the result that FFT(DFT) of each windowed signal and I can see the change of each frequency value over time. If I calculate the average of each frequency over the total…
1
vote
1 answer

No instance of overloaded function when resizing

I got an error of "No instance of overloaded function" when I used resize(). I'm aware that what's inside of resize() might be wrong as well. I'm trying to resize x, an array of floats to all zeros. Not sure if std::vector>(0, 0) would be the right…
linda meng
  • 53
  • 5