fft

Why do we use only the first buffer in aurioTouch project

放肆的年华 提交于 2019-12-12 09:49:56
问题 I'm investigating aurioTouch2 sample code. And I noticed, that when we analize audio data, we use only the first buffer of this data, and never other buffers. in void FFTBufferManager::GrabAudioData(AudioBufferList *inBL) function: UInt32 bytesToCopy = min(inBL->mBuffers[0].mDataByteSize, mAudioBufferSize - mAudioBufferCurrentIndex * sizeof(Float32)); memcpy(mAudioBuffer+mAudioBufferCurrentIndex, inBL->mBuffers[0].mData, bytesToCopy); in function static OSStatus PerformThru( void *inRefCon,

fftw c2c: missing symmetry in transformed real data

烈酒焚心 提交于 2019-12-12 09:48:21
问题 recently I faced some problems concerning the use of fftw and it's c2c transformation (see: 3d c2c fft with fftw library). As I located my problems in the use of the fftw lib I created a new Question in order to discus this situation in a more concrete way. Since I am doing a complex to complex transform with real data my transformed data in fourier space is supposed to be symmetric: F[n] = con(F[N-n]) Now I did some transformations with small blocks of test-data to check the transformed data

Deconvolution with R (decon and deamer package)

旧街凉风 提交于 2019-12-12 09:10:02
问题 I have a model of the form: y = x + noise. I know the distribution of 'y' and of the noise and would like to have the distribution of 'x'. So I tried to deconvolve the distributions with R. I found 2 packages (decon and deamer) and I thought both methods should make more or less the same but I don't understand why deconvoluting with DeconPdf gives me a something like a normal distribution and deconvoluting with deamerKE gives me a uniform distribution. Here is an example code: library

Is there a way to reduce scipy/numpy precision to reduce memory consumption?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 08:48:18
问题 On my 64-bit Debian/Lenny system (4GByte RAM + 4GByte swap partition) I can successfully do: v=array(10000*random([512,512,512]),dtype=np.int16) f=fftn(v) but with f being a np.complex128 the memory consumption is shocking, and I can't do much more with the result (e.g modulate the coefficients and then f=ifftn(f) ) without a MemoryError traceback. Rather than installing some more RAM and/or expanding my swap partitions, is there some way of controlling the scipy/numpy "default precision" and

[portaudio]Transmit and Detect frequency - Windows

我的未来我决定 提交于 2019-12-12 06:36:50
问题 I'm new to portaudio and i looked at "How to extract frequency..." question but still i would like to have some help. i need to transmit a frequency (using the speakers) and then i would like to check if this frequency was transmitted (catching it in the microphone), of course that i would like to use portaudio for the sending and detecting. also,i have no idea how to use the fft for detection because i saw the record example and they use a SAMPLE data type and with this data type they can

Methodology of FFT for Matlab spectrogram / short time Fourier transform functions

时光怂恿深爱的人放手 提交于 2019-12-12 06:09:00
问题 I'm trying to figure out how MATLAB does the short time Fourier transforms for its spectrogram function (and related functions like specgram, or stft in Octave). What is curious to me is that you can apparently specify the length of the window and the FFT length (number of output frequencies) independently, whereas I would have expected that these two should be equal (since the length of an FFT'd signal is the same as the length of the original signal). To illustrate what I mean, here is the

Compute time Series from PSD python

别来无恙 提交于 2019-12-12 06:07:29
问题 I have a signal spectrum PSD that looks like : The frequency range of the PSD is np.linspace(0,2,500). I want to convert this spectrum into a time series of 600s . The code is shown below: def spectrumToSeries(timeSeries,frequency,psdLoad): ''' Function that gicen a PSD converts into a time series ''' # #Obtian interval frequency df=frequency[2]-frequency[1] #Obtian the spectrum amplitudes amplitude=np.sqrt(2*np.array(psdLoad)*df) #Pre allocation of matrices epsilon=np.zeros((len(amplitude)))

NAudio WaspiLoopback Goertzel

余生长醉 提交于 2019-12-12 06:02:06
问题 Update #2: I kept messing more with the code, my only issue is that it is detecting frequencies when sound is present through the microphone but the algorithm is not working at all. I ask it for 500Hz and it'd output a power level even tough there was NO sound at that frequency. Code below (I have seen that this post haven't had much attention, thus why I'm updating constantly) private void button3_Click(object sender, EventArgs e) { waveIn = new WasapiLoopbackCapture(); waveIn.DataAvailable

Audio sampling rate of an ip camera and FFT

半城伤御伤魂 提交于 2019-12-12 04:31:00
问题 I am getting an array of bytes (size 64) from an audio input stream (from a camera with sampling rate Fs = 44100Hz, in java). And then I convert this array into an array of doubles (the size of this array becomes 8) and perform FFT with jtransforms library: DoubleFFT_1D fft = new DoubleFFT_1D(8); fft.realForward(doubles); And then I calculate frequencies: freq = i*Fs/N. My question is, N=8 or N=64? If N=8, should I somehow correct the value of rate sampling Fs? Would be very grateful for

GSL Fast-Fourier Transform - Double-Valued Gaussian?

自闭症网瘾萝莉.ら 提交于 2019-12-12 04:28:51
问题 All I want to do is evaluate the Fourier transform of a Gaussian (as a test of course), but I'm getting what looks like a double-valued function, as can be seen in the plot below. When you look closely at the tails of the Gaussian, you can see that the FFT returned values are actually oscillating between positive and negative, making the DFT look "double-valued". Why is this happening? Is there a way to fix this (without just plotting the complex modulus of course)? #include <gsl/gsl_fft