fft

How to convert wave data into Complex numbers

时光怂恿深爱的人放手 提交于 2019-12-21 04:40:52
问题 I'm reading raw data from a mic and feeding into FFT. Two of the FFT libraries I'm trying (AForge and Exocortex.DSP) takes Complex numbers as input and gives Complex numbers as output. I'm trying to understand what complex numbers are. More specifically - how do I convert the raw audio data obtained from a microphone into complex numbers for processing in FFT? And how do I plot the output to a nice spectrogram (that is; reading the frequencies and amplitudes from the output)? Added bonus:

cuFFT and streams

南笙酒味 提交于 2019-12-21 04:25:26
问题 I'm trying to launch multiple CUDA FFT kernels asynchronously using streams. For that, I'm creating my streams, cuFFT forward and inverse plans as follows: streams = (cudaStream_t*) malloc(sizeof(cudaStream_t)*streamNum); plansF = (cufftHandle *) malloc(sizeof(cufftHandle)*streamNum); plansI = (cufftHandle *) malloc(sizeof(cufftHandle)*streamNum); for(int i=0; i<streamNum; i++) { cudaStreamCreate(&streams[i]); CHECK_ERROR(5) cufftPlan1d(&plansF[i], ticks, CUFFT_R2C,1); CHECK_ERROR(5)

Threaded FFT in Enthought Python

拈花ヽ惹草 提交于 2019-12-21 02:52:13
问题 Fast Fourier Transforms (FFTs) in Numpy/SciPy are not threaded. Enthought Python is shipped with the Intel MKL numerical library, which is capable of threaded FFTs. How does one get access to these routines? 回答1: The following code works for me with Enthought 7.3-1 (64-bit) on Windows 7 Ultimate 64-bit. I haven't benchmarked it but it certainly uses all cores at once rather than just one. from ctypes import * class Mkl_Fft: c_double_p = POINTER(c_double) def __init__(self,num_threads=8): self

Removing periodic noise from an image using the Fourier Transform

不问归期 提交于 2019-12-20 21:41:28
问题 I am performing the 2D FFT on a particular image and I get its spectral components. Now this image has been superimposed with another image to create periodic noise. The original image as well as the periodic noise version is shown below: Original Image Periodic Noise Image To filter this out, I used manual boxes that masked the components in the magnitude spectrum that are quite large relative to the other components as shown below. After this is done, I perform an inverse FFT, but I do not

How to get the FFT of a numpy array to work?

流过昼夜 提交于 2019-12-20 20:30:08
问题 I'm reading a specific column of a csv file as a numpy array. When I try to do the fft of this array I get an array of NaNs. How do I get the fft to work? Here's what I have so far: #!/usr/bin/env python from __future__ import division import numpy as np from numpy import fft import matplotlib.pyplot as plt fileName = '/Users/Name/Documents/file.csv' #read csv file df = np.genfromtxt(fileName, dtype = float, delimiter = ',', names = True) X = df['X'] #get X from file rate = 1000. #rate of

How can I use fast FFT-based convolution to implement a LPF if the fast convolution requires a LPF?

孤街浪徒 提交于 2019-12-20 14:39:28
问题 I'm an experienced software engineer with some minor college DSP knowledge. I'm working on a smartphone application to process signal data, such as from the microphone (sampled at 44100 Hz) and the accelerometer (sampled at 32-50 Hz). My applications would be, for example, pitch detectors and so forth. I want to implement a low-pass filter (LPF) on the phone to remove aliased frequencies, particularly for the accelerometer, which has a low sampling rate. However, I am finding a contradiction

generating correct spectrogram using fftw and window function

瘦欲@ 提交于 2019-12-20 14:23:29
问题 For a project I need to be able to generate a spectrogram from a .WAV file. I've read the following should be done: Get N (transform size) samples Apply a window function Do a Fast Fourier Transform using the samples Normalise the output Generate spectrogram On the image below you see two spectrograms of a 10000 Hz sine wave both using the hanning window function. On the left you see a spectrogram generated by audacity and on the right my version. As you can see my version has a lot more

generating correct spectrogram using fftw and window function

大城市里の小女人 提交于 2019-12-20 14:20:10
问题 For a project I need to be able to generate a spectrogram from a .WAV file. I've read the following should be done: Get N (transform size) samples Apply a window function Do a Fast Fourier Transform using the samples Normalise the output Generate spectrogram On the image below you see two spectrograms of a 10000 Hz sine wave both using the hanning window function. On the left you see a spectrogram generated by audacity and on the right my version. As you can see my version has a lot more

Why isn't this inverse Fourier transform giving the correct results?

我怕爱的太早我们不能终老 提交于 2019-12-20 12:15:37
问题 I want to invert the Fourier transform of an image in MATLAB, but the result is not the original image (as it should be). There is obviously some implementation detail that I don't know about that's causing the issue. Here's the code: img = imread('img.jpg'); fft = fft2(img); inv = ifft2(fft); imshow(inv); 回答1: Since fft2 and ifft2 both perform calculations in either double or single precision, your image data (which is likely of type uint8) gets converted to type double first before being

Creating an iPhone music Visualiser based on Fourier Transform

大城市里の小女人 提交于 2019-12-20 10:55:11
问题 I am designing a music visualiser application for the iPhone. I was thinking of doing this by picking up data via the iPhone's mic, running a Fourier Transform on it and then creating visualisations. The best example I have been able to get of this is aurioTuch which produces a perfect graph based on FFT data. However I have been struggling to understand / replicate aurioTouch in my own project. I am unable to understand where exactly aurioTouch picks up the data from the microphone before it