fft

Designing a simple bandpass/bandstop filter in Matlab

[亡魂溺海] 提交于 2019-12-12 20:41:00
问题 For a homework assignment I have to design a simple bandpass filter in Matlab that filters out everything between 250Hz and 1000 Hz. What I did so far: - using the 'enframe' function to create half overlapping windows with 512 samples each. On the windows I apply the hann window function. - On each window I apply an fft. After this I reconstruct the original signal with the function ifft, that all goes well. But the problem is how I have to interpret the result of the fft function and how to

FFTW advanced layout — inembed=n and inembed=NULL give different results?

允我心安 提交于 2019-12-12 19:22:47
问题 I'm working with batched 2D FFTs using the FFTW advanced data layout API. According to the FFTW Advanced Complex DFT documentation: Passing NULL for an nembed parameter is equivalent to passing n . However, I'm getting different results when using inembed = onembed = NULL vs. inembed = onembed = n . What could be causing the results not to match? Let's do an example... Setup int howMany = 2; int nRows = 4; int nCols = 4; int n[2] = {nRows, nCols}; float* h_in = (float*)malloc(sizeof(float) *

2D Fourier Transformation in C

纵饮孤独 提交于 2019-12-12 18:35:31
问题 I implemented 2D DFT and IDFT using equation from this site http://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm I think these are correct and nicely explained. Implementation looks like that: for(int i=0;i<inImage.width;i++) { for(int j=0;j<inImage.height;j++) { float ak=0; float bk=0; for(int ii=0;ii<inImage.width;ii++) { for(int jj=0;jj<inImage.height;jj++) { float x=-2.0*PI*i*ii/(float)inImage.width; float y=-2.0*PI*j*jj/(float)inImage.height; // ak+=inImage.pixels[i][j]*(cos(x)*cos(y)-sin

Accelerate Framework FFT vDSPztoc split real form to split real vector

别来无恙 提交于 2019-12-12 18:29:36
问题 I am implementing an accelerometer-based FFT in iOS using the Accelerate Framework, but the one thing that I'm still a bit confused about is this part: /* The output signal is now in a split real form. Use the function * vDSP_ztoc to get a split real vector. */ vDSP_ztoc(&A, 1, (COMPLEX *) obtainedReal, 2, nOver2); What does the final array look like? I'm confused as to the distinction between "split real form" and "split real vector". I might have some understanding of what it means, but I

Perform Audio Analysis with FFT

会有一股神秘感。 提交于 2019-12-12 14:14:16
问题 I've been stuck on this problem for days now and have looked through nearly every related StackOverflow page. Through this, I now have a much greater understanding of what FFT is and how it works. Despite this, I'm having extreme difficulties implementing it into my application. In short, what I am trying to do is make a spectrum visualizer for my application (Similar to this). From what I've gathered, I'm pretty sure I need to use the magnitudes of the sound as the heights of my bars. So

Matlab FFT for gaussian function

删除回忆录丶 提交于 2019-12-12 14:14:05
问题 I am trying to obtain gaussian curve by using matlab's fft. The problem is that in one case my attemp to reduce noise by dividing F=dt.*F./exp(-1i.*nu.*T/2) is not working (img 1) and in the second case if I am trying to take absolute value of fft result's I dont have decent scale in graph (img 2). N=512; T=10; dt=T/(N-1); t=linspace(-5,5,N); f=exp(-t.^2); F=fft(f); F1=F(1:N/2+1); F2=F(N/2+1:N); F=[F2,F1]; dnu=(N-1)/(N*T); nuNyq=1/(2*dt); nu=-nuNyq+dnu*(0:N); F=dt.*F; %F=dt.*F./exp(-1i.*nu.*T

Matlab fft function swapping indices

廉价感情. 提交于 2019-12-12 14:13:34
问题 I've written a simple and very small Matlab code that calculates the Discrete Fourier Transfrom of a given array (or vector). I worked it out manually and got an answer and my Matlab code also giving the same answer. But fft is giving an answer different from this by swapping indices. Here are the mannual calculations that I've done: This is the second image: This is the third image: From those calculations it is clear that my answer would be {12, -3-3j, -2, -3+3j} Here is the Matlab code

FFT/NTT中档题总结

天大地大妈咪最大 提交于 2019-12-12 12:29:56
被DeepinC%怕了,把一些题放到这里来 T1Normal 其实这道题放到中档题也不太合适,个人感觉真的很难, 机房里好像都是颓的题解 因为期望的可加性,把每个点的贡献单独处理,即求期望深度 考虑$y$对$x$的贡献:当且仅当$x->y$的路径上第一个点就选$y$,$y$才能成为$x$的祖先 所以$y$对$x$的贡献就是:$P=\frac{1}{dis(x,y)+1}$,$E=1$ 所以最终答案就是$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}\frac{1}{dis(i,j)+1}$ 用点分治+$FFT$便可以$O(nlog_2^2(n))$解决 T2染色 题解在 二项式反演总结 里 T3城市规划 昨天推了一波式子,就被skyh和Deepinc狂%,但其实我的式子的组合数是错的 设$f[i]$代表$i$个点联通的方案数: 设$g[i]=2^{\frac{i*(i-1)}{2}}$ $f[i]=g[i]*\sum\limits_{j=1}^{i}C_{i-1}^{j-1}*f[j]*g[i-j]$ 便是一个裸的分治FFT了 来源: https://www.cnblogs.com/AthosD/p/12027865.html

Extract delta, theta, alpha, beta and gamma waves from signals

女生的网名这么多〃 提交于 2019-12-12 12:15:49
问题 I want to get delta, theta, alpha, beta and gamma waves from a set of signals. And this is how, till now I am doing it:- fs = 256 data=copy.deepcopy(features[:100]) data=np.reshape(data,(len(data),256,64)) # Get real amplitudes of FFT (only in postive frequencies) fft_vals=[] for d in data: fft_vals.append(np.absolute(np.fft.fft2(d))) fft_vals = np.array(fft_vals) print(fft_vals.shape) # Get frequencies for amplitudes in Hz fft_freq = np.fft.fftfreq(len(data), 1.0/fs) print(fft_freq.shape) #

Is there a method of FFT that will run inside CUDA Kernel?

五迷三道 提交于 2019-12-12 10:06:05
问题 I am currently converting a C++ program into CUDA code, and part of my program runs a fast Fourier transform. Originally I ran FFTW, but I saw that I couldn't call it in kernel, so I then rewrote that part using cufft but it tells me the same thing! Are there any FFT that will run inside a CUDA kernel? Can I just add __device__ to the fftw library? I would like to avoid having to initialize or call the FFT in host. I want a completely on the gpu type function, if one exists. 回答1: Are you sure