fft

How to remove repititve pattern from an image using FFT

How to remove repititve pattern from an image using FFT Question: I have image of skin colour with repetitive pattern (Horizontal White Lines) generated by a scanner that uses a line of sensors to perceive the photo. My Question is how to denoise the image effectively using FFT without affecting the quality of the image …

Total answers: 2

Determining Fourier Coefficients from Time Series Data

Determining Fourier Coefficients from Time Series Data Question: I asked a since deleted question regarding how to determine Fourier coefficients from time series data. I am resubmitting this because I have better formulated the problem and have a solution that I’ll give as I think others may find this very useful. I have some time …

Total answers: 3

Manipulate lists in a pandas data frame column (e.g. divide by another column)

Manipulate lists in a pandas data frame column (e.g. divide by another column) Question: I have a pandas data frame with one column containing lists. I wish to divide each list element in each row by a scalar value in another column. In the following example, I wish to divide each element in a by …

Total answers: 2

How to add a phase shift to a sin wave in the frequency domain with fft?

How to add a phase shift to a sin wave in the frequency domain with fft? Question: I want to shift a sine wave in the frequency domain My idea is the following: Fourier-Transform Add a phase shift of pi in frequency domain Inverse-Fourier-Transform In code: t=np.arange(0, 6 , 0.001) values = A*np.sin(t) ft_values= np.fft.fft(values) …

Total answers: 2

Python spectrogram in 3D (like matlab's spectrogram function)

Python spectrogram in 3D (like matlab's spectrogram function) Question: My question is the following: I have all the values that I need for a spectrogram (scipy.fftpack.fft). I would like to create a 3D spectrogram in python. In MATLAB this is a very simple task, while in python it seems much more complicated. I tried mayavi, …

Total answers: 2

Fourier Transform 2D artifact – what am I doing wrong?

Fourier Transform 2D artifact – what am I doing wrong? Question: So currently I’m trying to wrap my head around the fourier transform (in 2D). I wanted to fourier transform an image and return back in only the magnitude spectrum just like this topic on this site: https://dsp.stackexchange.com/questions/16995/image-reconstructionphase-vs-magnitude However my image (using spyder ide) comes …

Total answers: 2

fft division for fast polynomial division

fft division for fast polynomial division Question: I’m trying to implement fast polynomial division using Fast Fourier Transform (fft). Here is what I have got so far: from numpy.fft import fft, ifft def fft_div(C1, C2): # fft expects right-most for significant coefficients C1 = C1[::-1] C2 = C2[::-1] d = len(C1)+len(C2)-1 c1 = fft(list(C1) + …

Total answers: 1

only integers, slices (`:`), ellipsis (`…`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

only integers, slices (`:`), ellipsis (`…`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices Question: I am implementing fft as part of my homework. My problem lies in the implemention of shuffling data elements using bit reversal. I get the following warning: DeprecationWarning: using a non-integer number instead of an integer will result …

Total answers: 3

Plotting a fast Fourier transform in Python

Plotting a fast Fourier transform in Python Question: I have access to NumPy and SciPy and want to create a simple FFT of a data set. I have two lists, one that is y values and the other is timestamps for those y values. What is the simplest way to feed these lists into a …

Total answers: 7

Calculating nth Roots of Unity in Python

Calculating nth Roots of Unity in Python Question: So, I’m trying to write an algorithm croot(k, n), that returns the kth root of unity with n == n. I’m getting mostly the right answer, however it’s giving me really weird representations that seem wrong for certain numbers. Here is an example. import cmath def croot(k, …

Total answers: 4