Questions tagged [fft]
FFT is short for fast Fourier transform, any of a set of algorithms for quickly computing the discrete Fourier transform (DFT).
5,304
questions
2
votes
0
answers
18
views
Filtered backprojection
I'm working on a school project with python and I have to reconstruct an image using filtered backprojection. I made the image using the following code:
image = np.zeros([100, 100])
t = np.linspace(-...
0
votes
1
answer
18
views
How do I apply a Gauss Filter in Fourier Space?
I converted a Gauss filter, as well as an image I want to filter, into the fourier space. Are the rules of applying filters in the fourier space the same like in the image space? (e.g. just applying a ...
1
vote
1
answer
16
views
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 ...
0
votes
0
answers
21
views
fft() get amplitude, frequency, phase and invert back in series
I am very bad at spectral analysis, so please forgive me for stupid questions.
I found someone's code on the net to calculate the amplitude of the frequency and phase
y <- rnorm(50) # some series
...
0
votes
0
answers
9
views
How do I increase the sensitivity of a CNN autoencoder for anomaly detection, when my dataset contains mostly zero values?
I am learning to use autoencoders for anomaly detection. I am using the model provided on the keras website, with data that I have created. My ‘correct data’ used for training the model is a single ...
0
votes
1
answer
37
views
Python FFT - Output fft is the same as input function?
I am trying to perform an FFT on data from a simulation that has an oscilating shape. When I run the scipy FFT, the output is the same as the input and I can't figure out why. My code is below:
tstart ...
2
votes
1
answer
23
views
How to compute the gradient of a multidimensional array using numpy's fast Fourier transform
I wrote this short and simple python method the other day
def dFFT_1D(f):
k = 2*np.pi * np.fft.fftfreq(f.shape[0])
return np.fft.ifft(1j*k * np.fft.fft(f)).real
which takes a one-dimensional ...
0
votes
1
answer
17
views
vDSP.FFT Swift enum vs. vDSP_fft_zrip
Apple has provided a Swift vDSP enum for more intuitively doing operations.
With this you can convert less readable code like
vDSP_vmul(arrayA, 1, arrayB, 1, arrayC, 1, vDSP_length(arrayA.count))
to
...
0
votes
0
answers
21
views
Values of k to compute the derivative with fft
I get some trouble when I try to get the derivative of phi(x) by using the FFT.
l1=nk(T,n0)
l2=nk(T,n0)
l3=tetak(T,n0)
l4=tetak(T,n0)
dn=np.fft.irfft(l1+complex(0,1)*l2)*(N-2)/4
dtk=np.fft.irfft(l3+...
-1
votes
0
answers
14
views
Hermitian transformation frequencies? (hypothetical function numpy.fft.hfftfreq)
For a normal FFT, Numpy implements the method fftfreq(n,d), which provides the frequencies of the FFT right away. However, for the Hermitian transformation hfft, the companion function hfftfreq is ...
0
votes
1
answer
26
views
FFT not showing any dominant frequencies
I am trying to perform an FFT from time series data of DC motor current from "F.A.I.R. open dataset of brushed DC motor faults for testing of AI algorithms". However, the result does not ...
4
votes
0
answers
71
views
How to use mkl FFT to compute the convolution of a real image
I'm trying to compute the convolution of two images using the FFT implementation in mkl API.
The steps are:
Calculate the FFT of the two images
Multiply the spectra
Calculate the inverse FFT, that is ...
0
votes
0
answers
8
views
unit of scipy fft function
I have a small confusion on units of FT. I’m looking at the first graph of (https://docs.scipy.org/doc/scipy/tutorial/fft.html) and its corresponding code above the figure. I got that x-axis refers to ...
0
votes
0
answers
22
views
How to use KissFFT with audio?
I have an array of 2048 samples of an audio file at 44.1 khz and want to transform it into a spectrum for an LED effect. I don't know too much about the inner workings of fft but I tryed it using kiss ...
2
votes
2
answers
103
views
Have I applied the Fourier Transformation correctly to this Dataframe? [EXAFS X-Ray Absorption Dataframe]
I have a dataset with a signal and a 1/distance (Angstrom^-1) column.
This is the dataset (fourier.csv): https://pastebin.com/ucFekzc6
After applying these steps:
import pandas as pd
import numpy as ...
0
votes
0
answers
16
views
low pass filter in Frequency domain for EEG signals in MATLAB
I have an EEG file present in .mat structure. I want to apply low pass filter on the file (cutoff =70 Hz) but I am unsure how to do it. I have never done filtering in MATLAB.
The file looks like this.
...
0
votes
0
answers
48
views
Create surrogate data in python using fourier transform?
I want to create 10,000 sample (random phase but same power spectra) of my original time series using fourier transform. The method I want to opt is given in figure. The actual time series data can be ...
0
votes
0
answers
31
views
Does the Ne10 FFT implementation work on both Arm 32-bit `armv7l` and 64-bit `aarch64`?
I'm using Cortex-A53 processor for a C code project.
The project needs a Fourier transform, for which planned to use the Ne10 library.
The Cortex-A53 processor can work in two modes: as 32-bit armv7l ...
0
votes
1
answer
20
views
Removing sinusoidal oscillation from signal Python
Any suggestion for removing sinusoidal oscillation from such a signal?
0
votes
0
answers
19
views
Empty output when computing the cross correlation between 2D arrays which contain Nan values
I am trying to find the cross-correlation between two data sets of satellite images. I've filtered the satellite data for specific fields, and loaded them into Python to convert the .tif files to 2D ...
1
vote
1
answer
32
views
I/p frequency is 8000 Hz then why why does the output of following code shows peak at 2000 Hz?
The i/p frequency is 8000 Hz. Why does the o/p of the following code shows, a peak in spectrogram at 2000 Hz? I am new to the spectrogram, can anyone please explain?
from scipy import signal
import ...
0
votes
0
answers
15
views
Using KISS_FFT on a microcontroller
Im kinda new to the compilers concept.
a little context, im programing a microcontroler, im trying to use an IIS (MEMS) to read aceleration data, and then aplying a fft to the data, I start getting ...
1
vote
0
answers
16
views
nonlinear Schroedinger equation resolution with split step method
I'm trying to resolve a nonlinear PDE Schrödinger equation with the split-step Fourier pseudo-spectral method. The fonction "solver" is supposed to solve the time and space dependant ...
0
votes
1
answer
31
views
How to display more frequencies on the librosa spectogram
I'm trying to plot 44.1 kHz audio spectrogram with log-scale. But librosa shows only 2^14 (16384) Hz, but it should be something between 2^15 and 2^16 Hz. How I can plot full-scale spectrogram?
import ...
0
votes
0
answers
43
views
spatial domain convolution not equal to frequency domain multiplication using pytorch
I want to verify if 2D convolution in spatial domain is really a multiplication in frequency domain, so I used pytorch to implement convolution of an image with a 3×3 kernel (both real). Then I ...
0
votes
1
answer
18
views
Forecasting out of sample with Fourier regressors
I'm trying to create a multivariate multi-step-ahead forecast using machine learning (weekly and yearly seasonality).
I use some exogenous variables, including Fourier terms. I'm happy with the ...
0
votes
0
answers
34
views
Trying to write a custom loss function in tensorflow
I am trying to make a custom loss function where I perform an inverse fast Fourier transform to a set of data and then do the following calculations. When I run this model the gradient returns an ...
1
vote
0
answers
12
views
How do you turn an audio wave represented by values into a wavetable using Fast Fourier Transform?
I've scoured a lot of articles and links and questions here but I really can't get my head around FFT's. I'm simply trying to convert an array of values that represents a waveform, [0, 0.5, 1, 0.5, 0, ...
-2
votes
0
answers
17
views
PROBLEMS ON XFFT IP BLOCK
I need a problem on XFFT ip block and i couldnt find where my mistake is so need your helps!.I am giving input to XADC which is working in channel sequencer mode and reading 3 aux channels.One of aux ...
0
votes
0
answers
22
views
Cannot explain result of minimum-phase reconstruction of a windowed sinc function
I'm currently trying to calculate 'minimum-phase band-with limited step functions' (BLEP, see (1) and (2)) for synthesizing alias-free saw/square/triangle waves.
I think I understand most of the ...
1
vote
1
answer
48
views
How can I speed-up inverse-FFT in low-pass-filtering?
I have made a low-pass-filter for image analysis using 2-dimensional FFT.
It simply consists of 3 steps,
(1) FFT of an original image,
(2) replace high-frequency components (> cut-off frequency) by ...
0
votes
0
answers
36
views
Why does the Integral() function claim there is a singularity when there obviously isn't?
I am attempting to write a function which expands another into a Fourier series. However for some functions the integral() function keeps spitting out warnings claiming it has reached minimum step ...
-1
votes
2
answers
35
views
Getting frequency and amplitude from an audio file using FFT - so close but missing some vital insights, eli5?
tl/dr: I've got two audio recordings of the same song without timestamps, and I'd like to align them. I believe FFT is the way to go, but while I've got a long way, it feels like I'm right on the ...
-1
votes
0
answers
34
views
Are there any order analysis functions in Python?
I would like to perform the following order related tasks in Python:
Convert tachometer pulse signal to RPM signal
Convert RPM signal to even-angle signal
Time synchronous averaging
I am aware of ...
0
votes
1
answer
44
views
Scipy ifft gives different results with seemingly identical input
Why would xcorr and xcorr2 be quite different here? M1 and M2 are numpy matrices. M1.shape[0] = M2.shape[0]. xcorr is what I would expect with this operation, but xcorr2 is something totally ...
1
vote
0
answers
26
views
Get Fourier an and bn coefficients from fft
I have a signal which is periodic (think force acting on a specific point of a disc while rotating, for each angle the force is different, but over time the force at each angle does not change).
For ...
1
vote
1
answer
49
views
sympy symbolic fft of 1/cosh(x)
I'm trying to compute the symbolic fft of $1/cosh(x)$ via
# %%
import sympy as sp
import numpy as np
import sympy.abc as spa
g = sp.fourier_transform(1/sp.cosh(spa.x), spa.x, spa.k)
print(g)
sp....
0
votes
0
answers
11
views
Error showing when using Symfit function in python to fit curve made out of data from excel file
The code was just taken from the Symfit documentation.
https://symfit.readthedocs.io/en/stable/examples/ex_fourier_series.html
Now I only modified xdata and ydata to read it instead from an excel file ...
0
votes
0
answers
25
views
MATLAB: Linear Poisson Solver using iterative method
I am in the process of writing a 2D non-linear Poisson's solver. One intermediate test I performed is using my non-linear solver to solve for a "linear" Poisson equation. Unfortunately, my ...
3
votes
1
answer
38
views
Trying to plot Fourier sines
from matplotlib import markers
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.cm import get_cmap
plt.rcParams['figure.figsize'] = [9,9]
plt.rcParams.update({'font.size' : 16})
#...
0
votes
1
answer
55
views
Derivate in Fourier space with C++
I have a sine wave which I would like to transform into Fourier space. Then take derivative in Fourier space. Then transform my data back into real space. The final array should give me a cosine wave. ...
0
votes
0
answers
38
views
What is the inverse of torch.fft.fft() for pytorch1.10?
I am using 1.10.2+cu113.
In pytorch 1.7, the code is
ffted = torch.rfft(input, 1, onesided=False)
iffted = torch.irfft(ffted, 1, onesided=False)
I want to migrate it in new version of pytorch.
Here ...
0
votes
0
answers
20
views
Generating IFFT curve manually to use it for the forecasts
Data
fft_tr = np.fft.fft(demand)
psd = (fft_tr * np.conj(fft_tr))/len(fft_tr)
ampl = (np.sqrt(fft_tr * np.conj(fft_tr))/(len(fft_tr)/2)).real
freq = 1/(1*len(train_df.demand)) * np.arange(len(train_df....
1
vote
1
answer
48
views
Is this dct (FFTW.jl) behavior in julia normal?
I'm trying to do some exercises of Compressed Sensing on Julia, but i realize that the discrete cosine transformation (using FFTW.jl) of an identity matrix doesn't looks as the result of other ...
-1
votes
2
answers
66
views
Fourier transform of non periodic signal
I'm trying to calculate the Fourier transform of non periodical data in python, with non periodical I mean this. Usually we use have periodical data:
x=[0,1,2,3,4,5,6,7]
y=[1,0,2,0,1,0,1,0]
And the ...
1
vote
0
answers
19
views
Cannot make sense of this error (ERROR: endpoints do not enclose a minimum (gsl: fsolver.c:126))
I'm working with this code: https://github.com/UCLA-TMD/Ogata. If performs a fast fourier transform.
It integrates the function test, according to some predefined options that are argument of the FBT ...
0
votes
0
answers
63
views
Fast Fourier Transform on Python
I would like some guidance on the proper way to compute a FFT on python for a real, non-periodic signal. I am relatively new to coding and signal analysis, so this post will contain questions ...
0
votes
0
answers
22
views
How can I make the Fourier Trnasformation of a signal with node red? [duplicate]
Im trying to transform a signal with Fourier in node red but I am only able to do it with python and node red uses java script. Is it possible to transform it in a function node?
There is a package ...
7
votes
1
answer
235
views
How to decompose multiple periodicities present in the data without specifying the period?
I am trying to decompose the periodicities present in a signal into its individual components, to calculate their time-periods.
Say the following is my sample signal:
You can reproduce the signal ...
0
votes
0
answers
12
views
How to embed and hide 12 digits decimal number in wav signal ( with FFT ) and extract number again (in C# .net)?
I gonna implement program that embed and hide 12 digits decimal number
into .wav file audio signal and it's don't affect to file sound human
hear, then after while I want extract same 12 digits ...