fft

Comparing Naive Inverse Filter to Wiener Filter for Deconvolution in Matlab

廉价感情. 提交于 2021-02-20 19:34:04
问题 I am currently trying to compare a simple inverse filter to the wiener filter for deconvolution using matlab. My starting signal is exp(-t^2) and this is to be convolved with a rect that is nonzero for times -.5 to .5. I am introducing noise with amplitude in the range -.5 to .5. Defining my time domain to frequency domain mapping: f = exp(-t^2) => F s = rect => R c = f*s => C r = noise (see above) => R with noise c becomes: c = f*s + n => C = FxS + N For the first approach I am simply taking

Why is my data in the frequency domain “mirrored” when performing (2d) IDFT into DFT using FFTW?

狂风中的少年 提交于 2021-02-20 00:49:55
问题 I am manually initializing a state in the 2d frequency domain by setting the real components of certain modes in a 16x16 data set. I then perform a 2d IDFT to acquire the real domain data. This all works as expected. I then perform a DFT on the real domain data to get back (what should be) identical frequency modes to those that I manually initialized. However, they come back with their amplitudes halfed, and their vertical frequencies "mirrored". To illustrate: Input modes: k[1, 0]: 32 + 0i

How to apply phase correlation in 1D signal?

牧云@^-^@ 提交于 2021-02-10 23:27:33
问题 Log polar transform is commonly used in image with phase correlation using Fourier transform for estimating rotation and translation etc. However, I am little confusing how to apply it in audio signal. I am trying to estimate time shift between two audio signal through log polar transform (LPT) and phase correlation. I applied LPT using https://en.wikipedia.org/wiki/Log-polar_coordinates in audio signal and plotter using matlab with polar(theta,rho), until here, there is no problem, problem

Strange issue when storing FFT periods in Pandas dataframe

白昼怎懂夜的黑 提交于 2021-02-10 19:57:51
问题 I am trying to store the results of FFT calculations in a Pandas data frame: ft = pd.DataFrame(index=range(90)) ft['y'] = ft.index.map(lambda x: np.sin(2*x)) ft['spectrum'] = np.fft.fft(ft['y']) ft['freq'] = np.fft.fftfreq(len(ft.index)).real ft['T'] = ft['freq'].apply(lambda f: 1/f if f != 0 else 0) Everything seems to be working fine until the last line: the column T which is supposed to store periods has for some reason all the columns of the frame, ie.: In [499]: ft.T[0] Out[499]: y 0j

Strange issue when storing FFT periods in Pandas dataframe

家住魔仙堡 提交于 2021-02-10 19:57:33
问题 I am trying to store the results of FFT calculations in a Pandas data frame: ft = pd.DataFrame(index=range(90)) ft['y'] = ft.index.map(lambda x: np.sin(2*x)) ft['spectrum'] = np.fft.fft(ft['y']) ft['freq'] = np.fft.fftfreq(len(ft.index)).real ft['T'] = ft['freq'].apply(lambda f: 1/f if f != 0 else 0) Everything seems to be working fine until the last line: the column T which is supposed to store periods has for some reason all the columns of the frame, ie.: In [499]: ft.T[0] Out[499]: y 0j

Ideal Low Pass Filter Concept in MATLAB

…衆ロ難τιáo~ 提交于 2021-02-10 16:22:43
问题 Please help me understand the following MATLAB code for Ideal Low pass filter. I am unable to understand the Part2 in the below code. Please explain me why we are doing like this. I have read the Rafael C. Gonzalez's Digital Image Processing Using Matlab 2E which explains my question but I couldn't understand properly. It will be helpful if someone could explain me clearly. Note: Dogbert, my understanding is that applying transform to an image help to separate low and high frequency

how to get cufftcomplex magnitude and phase fast

落花浮王杯 提交于 2021-02-08 10:07:59
问题 i have a cufftcomplex data block which is the result from cuda fft(R2C). i know the data is save as a structure with a real number followed by image number. now i want to get the amplitude=sqrt(R*R+I*I), and phase=arctan(I/R) of each complex element by a fast way(not for loop). Is there any good way to do that? or any library could do that? 回答1: Since cufftExecR2C operates on data that is on the GPU, the results are already on the GPU, (before you copy them back to the host, if you are doing

how to get cufftcomplex magnitude and phase fast

醉酒当歌 提交于 2021-02-08 10:04:56
问题 i have a cufftcomplex data block which is the result from cuda fft(R2C). i know the data is save as a structure with a real number followed by image number. now i want to get the amplitude=sqrt(R*R+I*I), and phase=arctan(I/R) of each complex element by a fast way(not for loop). Is there any good way to do that? or any library could do that? 回答1: Since cufftExecR2C operates on data that is on the GPU, the results are already on the GPU, (before you copy them back to the host, if you are doing

Third octave frequency spectrum with python

可紊 提交于 2021-02-08 06:56:41
问题 I am trying to get a third-octave frequency spectrum of a time signal. The time signal is the acoustic pressure of rotational rotor noise which is harmonic. Its fundamental frequency is ff = n * N_b and for that reason, all frequencies should be multiples of ff. Using fft I get the expected result: Multiples of the fundamental frequency are the relevant frequencies in the spectrum. To get the third-octave frequency spectrum I wanted to use python acoustics, but the result of the function

FFT Calculating incorrectly - Swift

 ̄綄美尐妖づ 提交于 2021-02-07 08:39:47
问题 I am trying to take the fast Fast Fourier Transform. I am basing my calculation off of the Surge. I am having trouble getting correct results. When I take the fft of a 1000 hz sound I get something that looks like this. . When i take the same tone and use python I get something that looks way more correct. The python code looks like: import numpy as np import scipy.io.wavfile import numpy.fft import matplotlib.pyplot as plt FILENAME = 'beep.wav' fs, data = scipy.io.wavfile.read(FILENAME) data