Questions tagged [fft]

FFT is short for fast Fourier transform, any of a set of algorithms for quickly computing the discrete Fourier transform (DFT).

fft
Filter by
Sorted by
Tagged with
0 votes
0 answers
37 views

I am trying to implement fft2 (scipy) function for the two time matrix Fourier Transform and struggling with the extraction of relevant frequency

here is the code : import numpy as np import numpy.fft as fft import scipy.optimize as opt import scipy.integrate as scint from scipy.linalg import expm import matplotlib import matplotlib.pyplot as ...
karungadge photos's user avatar
0 votes
0 answers
28 views

Join two fft frequency spectra

I have two frequency maps obtained from numpy fft. Like so: def fft(self): Y = np.fft.fft(self.data) # fft computing and normalization Y = 2.0/self.len * np.abs(Y[:self.len//2]) frq = np....
Lex Podgorny's user avatar
  • 2,718
0 votes
0 answers
135 views

how to plot the Frequency Analysis of a random images of MNIST?

I'd like to load MNIST and compute the amplititude of the power spectra of some random images. What I recive is very differnt from what I expected. How to compute the amplitude of power spectra nd ...
Rainbow's user avatar
  • 191
0 votes
0 answers
57 views

Linear convolution and ifft doesn't give the same results

% Define the sequences x[n] and h[n] n = 0:3; x = cos(pi*n); h = 2*n; % Compute the four-point DFT of x[n] X = fft(x); % Compute the four-point DFT of h[n] H = fft(h); % Compute y[n] = x[n] * h[n] ...
Muhammad Attaullah Khan's user avatar
0 votes
0 answers
50 views

Differentiable bandpass filter?

Does anyone know of any code or implementation of a differentiable bandpass filter, one that is differentiable with respect to frequency? I am trying to optimize a filterbank and need a filterbank ...
Mason Wang's user avatar
0 votes
0 answers
156 views

manim using fourier transform FFT

I try using manim to plot the fourier transform of a function but it gives me this error as i use the fft() method. from manim import * from numpy import sin import numpy as np class sampling(Scene): ...
Egyptian man.'s user avatar
0 votes
0 answers
142 views

traveling sine wave with rotating point on circle

%%manim -ql SineFunctionWithUnitCircle from manim import * class SineFunctionWithUnitCircle(Scene): # contributed by heejin_park, https://infograph.tistory.com/230 def construct(self): ...
Kebab Sharif's user avatar
1 vote
0 answers
72 views

Problem translating simple Matlab function to Python: ifft results are different

I am trying to translate to Python a Matlab function that calculates the Stockwell Transform for a time serie. The function ("stran") is taken from FileExchange: https://ch.mathworks.com/...
user169511's user avatar
0 votes
1 answer
45 views

how use fft in accelemetros data to transform in spectrum power?

I placed vibrations of a component using accelerometers, then produced a dataframe with accelerations, that is, dataframe with the following columns: accX, accY and accZ. It is a variable in time, ...
Renan Saraiva dos Santos's user avatar
1 vote
0 answers
126 views

Fast Fourier 2D Convolution for Neural Networks

I am stuck on implementing a 2D FFT Convolution on a neural network that I am working on. The shape of my input goes as X.shape = (100000, 1, 32, 32), where the convention here goes like (instances, ...
Newbie's user avatar
  • 41
0 votes
0 answers
66 views

I am trying to implement jpeg compression using FFT2 instead of DCT2 in Matlab and export binary files to be decoded

As per the title, I am having more trouble trying to convert to binary file. Below are my steps. JPEG Compression Steps Convert RGB into 3 channels For each channel (Y,Cb,Cr) (2.1) If channel is Cb ...
Linn Htet Aung's user avatar
-1 votes
1 answer
252 views

Welch for 2d (or nd) in python

I am looking for an implementation of Welch periodogram, similar to scipy.signal.welch that handles nd array. Things I tried : Numpy allows for nd fft using fftn but does not provide Welch algorithm. ...
mocquin's user avatar
  • 454
0 votes
0 answers
105 views

Measuring the dB of a frequency after FFT

I have a wavfile that is read and fft'd. Sampling frequency is 22050Hz. fs, y = scipy.io.wavfile.read('StarWars60.wav') N = len(y) yf = rfft(y) xf = rfftfreq(N, 1/fs) y is int16 and takes range [-...
Ian Low's user avatar
  • 399
0 votes
2 answers
260 views

Scipy FFT accuracy is much worse than analytical FT of a box function

I'm trying to check the accuracy of the scipy Fast Fourier Transform function using a box function which has a defined analytical expression, a sinc function. The result of the scipy FFT gives values ...
Gabriel 's user avatar
0 votes
0 answers
43 views

Fast Fourier Transform of a signal

I have an excel file which has time and magnitute columns of a signal. The signal is overlap of 4 different signals. It has 100 data points for a second and continues for 10 mins. How can I take Fast ...
qwe's user avatar
  • 1
-2 votes
1 answer
125 views

FFT: time-domain features to frequency domain

I am not from Physics or electrical engineering, so the answers I read related to my only confused me the more. So I asked this case-specific question. I work with a sensor data (time series). The ...
Amina Umar's user avatar
0 votes
1 answer
267 views

FFT IP Core - the results of Matlab and FFT IP Core didn't match?

I asked this while back in Xilinx Forum but I got no help, still need the help that's why am asking here. I am working on FFT IP Core to match its result with Matlab. I created an RTL Kernel(XO) using ...
A.A.'s user avatar
  • 145
1 vote
1 answer
71 views

Fourier synthesis of 3d medical imagiing

I am trying to generate 3-dimensional image. Using optimization - where wave frequencies and amplitudes will be learned. Hence given a set of frequencies, amplitudes and shifts I would like to create ...
Jakub Mitura's user avatar
3 votes
1 answer
67 views

Issue with implementing inverse FFT for polynoms

I am studying the FFT algorithm for fast polynomial multiplication. We went over the algorithm and I decided to try and implement it in Python. from typing import List import numpy as np def fft(p: ...
Rami Hashan's user avatar
0 votes
1 answer
226 views

Python: Why is FFT giving different results for the same data?

I have a datafile named 'yclip.txt' which is just a 1-column data. The program finds the the gradient of the autocorrelation function (here, dacf) of this data using the function ps.acf_dacf(). It ...
Amarnath4040's user avatar
0 votes
1 answer
317 views

is it possible to get exactly the same results from tf.signal.frame followed by tf.signal.rfft and librosa.stft?

I have calculated stft by initially framing the audio signal using tf.signal.frame and applying Real-valued fast Fourier transform over each frame using tf.signal.rfft. code look like : audio = '...
Smitha Prem's user avatar
-1 votes
1 answer
100 views

How do I reconstruct all Fourier coefficients from 2D r2hc transform in FFTW?

I have 3D real data, say, 64 * 64 * 64 real data points, and I want to do a 3D Fourier transform. Specifically, I want to do DFT (exponential transform, containing both sine and cosine terms) on two ...
Dennis's user avatar
  • 109
4 votes
1 answer
179 views

C++: Attemping to use std::rotate with fftw_complex data yields error: "array must be initialized with a brace-enclosed initializer"

I am trying to understand how to utilize the fft to process data I capture with a software defined radio. I discovered C++'s fftw3 library and attempted to look up some documentation or tutorials, and ...
OzzlyOsborne's user avatar
0 votes
0 answers
556 views

Using Intel IPP's (Integrated Performance Primitive) FFT Function with non power of 2 array

I am using Intel IPP's FFT (Fast Fourier Transform) function in my project. But my input data size is changeable. But IPP's FFT function allows only array with length of power of 2. So i tried to ...
Hansov's user avatar
  • 1
1 vote
0 answers
80 views

Fourier regression using FFTW in C

I tried to make Fourier regression using the FFTW library #include <stdio.h> #include <math.h> #include <fftw3.h> #define PI 3.14159265358979323846 int main() { int n = 100; ...
Googlebot's user avatar
  • 15.5k
1 vote
0 answers
88 views

circular image with vertical periodic noise restoration by FFT

I have a circular image with vertical periodic noise, when I tried to use FFT and a vertical hard mask to eliminate these vertical lines,the circular shape border affects the result greatly. Is there ...
Kevin's user avatar
  • 71
0 votes
1 answer
131 views

Why FFTW3's DST Type-1 (discrete sine transform) function is slow?

I used fftw3 s FFTW_RODFT00 function, but it's very slow (as they mentioned in documents. fftw3 2.5.2 Real even/odd DFTs). // N->Array length, input->Input Array, output->Output Array ...
Hansov's user avatar
  • 1
0 votes
1 answer
260 views

How to record 2 dimensional FFT data in a Prometheus/Micrometer metric?

I want to use a few Android phones as a remote audio frequency detectors, and I need to collect the data from a few different phones and analyse them centrally using Prometheus/Grafana. I've got an ...
aSemy's user avatar
  • 6,499
0 votes
0 answers
92 views

How to compute IFFT in MATLAB when the coefficient array is dependent on a parameter in physical space?

First off, sorry for the poor math notation - there was no other way to properly describe the problem. Let's say I have a variable u(x,y,z,t) that I have Fourier transformed (abstractly, at the very ...
gettingmathy's user avatar
0 votes
1 answer
147 views

Cannot stretch the audio file

I'm trying to stretch original wav file to k times. In the code below I'm using stretch_factor=2, but in theory I want any k there. My problem is the output.wav not stretched and even audio now is ...
EgorCry's user avatar
0 votes
1 answer
258 views

Scipy FFT reduce bin count

I have a waveform sig that I'd like to run an FFT on. The data is sampled at 40 kHz and I want to analyze a window of 25mS or 1000 points. Using scipy.fft.rfft(sig) I get a resulting waveform that has ...
eh_whatever's user avatar
1 vote
0 answers
78 views

Plot discrete fourier transformation of Gaussian function using python

I was given the Gaussian function g(t)=(1/sqrt(pi) * t_H)e^{-(t/t_H)^2}$ with t_H=5 and t_H=15. I plotted the two functions over the interval [-50,50] with dt=10^{-3} using python. Here is my code: # ...
LianNuo 's user avatar
1 vote
0 answers
151 views

Fourier transform with cuFFT, are complex to complex more efficient?

I'm writing a code that integrates a PDE in time in Fourier space, and I'm doing so in CUDA/C++. There is one real valued array I need to evolve in time. I've written the code in two different ways, ...
MyUserIsThis's user avatar
0 votes
0 answers
294 views

Creating Sine wave Signal in Flutter (FFT)

I am trying to create a mock signal to input into my Fast Fourier transform so to test if it is working, though, after countless hours of struggle, I realize that the issue is the signal I generate ...
sleepyboi's user avatar
0 votes
0 answers
89 views

Difference between `scipy.ndimage.fourier_gaussian` and own implementation

I am trying to implement myself a 2D gaussian filter (to debug some C++ code, outside the scope of this question). I focus on the first step: multiplication of the image and the Gaussian kernel in the ...
dagnic's user avatar
  • 159
0 votes
0 answers
34 views

Matlab function dependent on time matrix

How could you make a function in matlab where at a desired value of time, I can tell if a function, is above or below a threshold, given the time span is very small (essentially, for t = 0:1/2000000:1/...
Sensei82013's user avatar
1 vote
0 answers
109 views

How to increase fft time resolution also frequency resolution at the same time?

I'm a newbie learning FFT, I'm writing fft using swift vDSP to process audio from the microphone. My goal is to fine-tune the calculation to 0.1 Hz on the audio whose frequency changes every 0.1 ...
pekkabear's user avatar
1 vote
1 answer
140 views

Phase of Fourier Transform in Python

I have the following code in python: import numpy as np import matplotlib.pyplot as plt from scipy.fft import fft, ifft, fftshift def FourierTrans(S, t): fs = 1 / (t[5] - t[4]) y = fft(S, len(...
Soun's user avatar
  • 11
1 vote
1 answer
418 views

How can I apply a low pass and high pass filter to a time series dataset using scipy?

I have a time series dataset with sample rate 1/10 and sample size 8390. I just want to apply low and high pass filters for the first 1000 and last 1000 samples so I can compute a fourier transform ...
Passion4Cats22's user avatar
0 votes
1 answer
41 views

updating chosen elements in Pygame

I am working on animation of Fourier Transform in python, pygame. I want the result to look more or less as following: https://www.youtube.com/watch?v=ACvXAjZE9jQ I need to update the screen in order ...
CodeForFun's user avatar
-1 votes
1 answer
85 views

Fourier transform with pyfftw module problem

To test the pyfftw module, I tried to compute the fourier transfom of a gaussian function knowing that the result is an other gaussian function. But there is what I get : a complet no sense result. ...
Ghilas 's user avatar
1 vote
0 answers
28 views

how to resample fft after changing fftfreq

I want to change the frequencies of a wav music file, and I am using scipy.fftpack. May I ask how can I resample X after manipulating freq? X = fftpack.fft(music) freq = fftpack.fftfreq(len(X)) * ...
Xueqing Chen's user avatar
0 votes
1 answer
181 views

opencv c++ inverse fourier transformation does not give same image

I have a bgr image and convert to lab channels. I tried to check if the idft image of the result of dft of L channel image is the same. // MARK: Split LAB Channel each cv::Mat lab_resized_host_image; ...
Hyun Bin CHo's user avatar
0 votes
1 answer
131 views

FFT Not Getting Expected Results And Too Much Noise

Here's my code: close all;clc;clear all; f=fopen ('sum_021223.txt'); Adata=cell2mat(textscan(f, '%f %f %f %f %f')); time=Adata(:,5); data = Adata; data(:,5:end) = 0; final=size(data,1); data(1,1)=...
Kristian Dolghier's user avatar
0 votes
0 answers
26 views

How to do canvas operations with Complex numbers

I want to use FastFourierTransformer to convert AudioRecord ByteArray from time domain to frequency domain. Ultimately, I want to use the frequencies to draw on the Canvas. However, ...
X09's user avatar
  • 3,887
0 votes
1 answer
154 views

Time response of a double sided frequency response

I am trying to learn more about fourier transforms and inverse fourier transform. For the example below, I am unable to understand the time response signal. Here is what I am doing, Step 1: I am ...
Adam Merckx's user avatar
  • 1,144
0 votes
1 answer
180 views

Getting frequencies and magnitudes from audio sample using FFT

I am currently working on a music visualization LED strip display (similar to this) but got stuck at the process of extracting audio frequency / magnitude from the sample data. The entire process ...
Jezor's user avatar
  • 3,376
2 votes
1 answer
70 views

Find the time the music sound starts

I have this sound file where I am looking for the time the music starts. I am limited to using only the scipy module. How do I detect the time on x axis when the sound starts? An example figure is ...
smomajay's user avatar
2 votes
1 answer
104 views

Swift. frequency of sound got from vDSP.DCT output differs from iPhone and iPad

I'm trying to figure out the amplitude of each frequency of sound captured by microphone. Just like this example https://developer.apple.com/documentation/accelerate/...
dpr's user avatar
  • 349
2 votes
0 answers
122 views

FFT image clearing

I am using python and I need to implement a function to clear a pattern noise from images, I write this function and I get an OK result on some images but on others, I get a bad result, can U guys ...
Maor Israeli's user avatar

1
4 5
6
7 8
113