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
0 answers

Passing Depth first traversal test

This DepthFirstTraversal method works. However, it is only passing 9 out of the 13 tests. I have included the test class below with the test which isn't working. Please, could someone help me to understand why it's passing all the tests except this…
ollie
  • 11
  • 1
1
vote
0 answers

Depth first traversal algorithm implementing all of the methods in the interface

This is the class which is where I have implemented the depth first traversal algorithm, however when testing it doesn't pass the tests. public class DepthFirstTraversal extends AdjacencyGraph implements Traversal { private HashMap
Ollie
  • 13
  • 4
1
vote
1 answer

Reconstruct image using inverse DFT and magnitude + phase matrices in OpenCV

Assuming the official DFT tutorial (using java bindings) https://docs.opencv.org/3.4/d8/d01/tutorial_discrete_fourier_transform.html I do the following: Mat complexI = new Mat(); Core.merge(planes, complexI); // Add to the expanded…
PentaKon
  • 4,139
  • 5
  • 43
  • 80
1
vote
1 answer

Why does my 2D IDFT produce double the expected amplitudes? (FFTW)

I am using a complex-to-real 2D IDFT to visualize complex signals as an image. I initialize the complex frequency domain by manually setting modes. However, some modes produce real output that seems to be double what is expected. My code: int N =…
Naemesis
  • 139
  • 5
1
vote
1 answer

How to detect a basic audio signal into a much bigger one (mpg123 output signal)

I am new to signal processing and I don't really understand the basics (and more). Sorry in advance for any mistake into my understanding so far. I am writing C code to detect a basic signal (18Hz simple sinusoid 2 sec duration, generating it using…
kokkorikko
  • 13
  • 2
1
vote
1 answer

Incorrect Indexing in Rader Algorithm (GNU Octave implementation)

Rader DFT algorithm implemented using GNU Octave (for example, length 11). I used this wikipedia article. The values obtained are correct, but they are incorrectly reindexed. I can not understand where the error is? upd. Add function for finds the…
1
vote
0 answers

Image Transformation Functions to Identify if the Text in the Document Originally There or Just Synthetically Overlaid

I have a copy of scanned ancient dirty document and synthetically generated ancient dirty documents. I want to use Discrete Cosine Transform to characterize noise types existing in the document and identify if the text in the document originally…
alyssaeliyah
  • 2,214
  • 6
  • 33
  • 80
1
vote
2 answers

How to produce a detailed spectrogram from Fourier output?

I am developing a little application in Visual Studio 2010 in C# to draw a spectrogram (frequency "heat map"). I have already done the basic things: Cut a rectangular windowed array out of the input signal array Feed that array into FFT, which…
1
vote
1 answer

How do I access the dynamically allocated 2D array of type fftw_complex in FFTW after a 2D r2c transformation?

#include #include #include #include int main(){ int N=2000; int i,j; FILE *filepointer; filepointer=fopen("2DDFT_spacetime.plt","w"); //double in[N][N]; double *in; fftw_complex…
mmrbest
  • 11
  • 3
1
vote
0 answers

The phase of FFT in python and octave does not work properly

I've been trying to plot the amplitudes and phases of the DFT against the frequency indices in both Octave and Python (Spyder) but the phases seem wrong. When I do the FFT of a cosine function (the one in the codes) which should have no phase at all…
1
vote
0 answers

Discrepancies in FFT algorithms

I have seen many illustrations on the topic of FFT. I've seen a basic difference between DIT and DIF, however even with DIT alone, with the same sample size I've seen few versions with different twiddle factors, some with and some without…
GPlayer
  • 131
  • 1
  • 7
1
vote
1 answer

Implementing DFT, inverse function not working properly

I've implemented DFT and the inverse DFT Function according to the following formulas: The DFT function works, but when testing the inverse on the output I don't get the original series. import numpy as np import random exp = np.exp pi =…
user10695266
1
vote
1 answer

How to input complex values to the OpenCV function cv.dft()?

I am trying to implement what is stated in a research paper. It describes how to extract Fourier features from images. I tried to follow the steps while coding but repeatedly faced errors related to datatypes and dimensions of the input array. So I…
Vishwad
  • 251
  • 3
  • 18
1
vote
1 answer

Computing the phase spectrum of a signal

Using the output from either JTransform, or JWave, how should the phase spectrum be computed? Do I simply write a similar method, but instead I compute the phase using: Math.atan2(im / re) * Math.PI * 180? I've used the following to calculate the…
Dan
  • 75
  • 6
1
vote
1 answer

Spectral and Spatial Measures of Sharpness - How to calculate slope of magnitude spectrum?

I am trying to implement the S1 measure (Spectral Measure of Sharpness - Section III-A) from this paper. Here we have to calculate slope (alpha) of the magnitude spectrum for an image in order to measure sharpness. I am able to write the other part…
Malgo
  • 1,871
  • 1
  • 17
  • 30