dft

PERFORMING FFT on EEG SIGNAL USING MATLAB

倖福魔咒の 提交于 2019-12-04 19:38:32
i have acquired a 5 minutes raw eeg from NEXUS 10 mark 2 equipment and it is giving me output in the matlab as 1 x 76800 row vector. as i understand , the sampling frequency choosen is 256 hz , hence it is giving me total 76800 sampling points. no wat i m perfoming N point FFT on this raw eeg signal. since N can only be power of 2 i am EXTRACTING 65536(2 ^16) SAMPLING POINTS FROM RAW EGG i.e. from 76800 points i have taken 65536. now i am not able to perform fft on the this vector (65536 sampling points) please anybody can guide..as i am a beginner.. i have tried dis so far x=raw(1,1:65536);

fft2 in MATLAB vs dft in OpenCV C++ speed comparison

こ雲淡風輕ζ 提交于 2019-12-04 14:38:00
I'm wondering why the dft function in OpenCVC++ is a lot slower than fft2 for 2D matrices. The following C++ code is from the documentation : void fft2(const Mat in, Mat &complexI) { Mat padded; int m = getOptimalDFTSize(in.rows); int n = getOptimalDFTSize(in.cols); copyMakeBorder(in, padded, 0, m - in.rows, 0, n - in.cols, BORDER_CONSTANT, Scalar::all(0)); Mat planes[] = {Mat_<float>(padded), Mat::zeros(padded.size(), CV_32F)}; merge(planes, 2, complexI); dft(complexI, complexI); } int main(){ Mat a(5000, 5000, CV_32F); randn(a, 0, 1); Mat res; clock_t start = clock(); fft2(a,res); cout <<

Shift theorem in Discrete Fourier Transform

↘锁芯ラ 提交于 2019-12-04 14:14:18
问题 I'm trying to solve a problem with python+numpy in which I've some functions of type that I need to convolve with another function . In order to optimize code, I performed the fft of f and g, I multiplied them and then I performed the inverse transformation to obtain the result. As a further optimization I realized that, thanks to the shift theorem, I could simply compute once the fft of f(x,y,z) and then multiply it by a phase factor that depends on to obtain the fft of . In particular, ,

DFT to spatial domain in OpenCV is not working

一笑奈何 提交于 2019-12-04 13:24:37
问题 I have created dft of an image and after some adjustment with filters i want to convert it back to the real image but every time when i do that it gives me wrong result ..seems like its not converting it back. ForierTransform and createGaussianHighPassFilter are my own functions rest of the code i am using like below for the inversion back to real image. Mat fft = ForierTransform(HeightPadded,WidthPadded); Mat ghpf = createGaussianHighPassFilter(Size(WidthPadded, HeightPadded), db); Mat res;

How can I transfer a discrete set of data into the frequency domain and back (preferrably losslessly)

浪子不回头ぞ 提交于 2019-12-03 21:32:40
I would like to take an array of bytes of roughly size 70-80k and transform them from the time domain to the frequency domain (probably using a DFT). I have been following wiki and gotten this code so far. for (int k = 0; k < windows.length; k++) { double imag = 0.0; double real = 0.0; for (int n = 0; n < data.length; n++) { double val = (data[n]) * Math.exp(-2.0 * Math.PI * n * k / data.length) / 128; imag += Math.cos(val); real += Math.sin(val); } windows[k] = Math.sqrt(imag * imag + real * real); } and as far as I know, that finds the magnitude of each frequency window/bin. I then go

DFT to spatial domain in OpenCV is not working

混江龙づ霸主 提交于 2019-12-03 09:23:49
I have created dft of an image and after some adjustment with filters i want to convert it back to the real image but every time when i do that it gives me wrong result ..seems like its not converting it back. ForierTransform and createGaussianHighPassFilter are my own functions rest of the code i am using like below for the inversion back to real image. Mat fft = ForierTransform(HeightPadded,WidthPadded); Mat ghpf = createGaussianHighPassFilter(Size(WidthPadded, HeightPadded), db); Mat res; cv::multiply(fft,ghpf,res); imshow("fftXhighpass1", res); idft(res,res,DFT_INVERSE,res.rows); cv::Mat

Why is FFT of (A+B) different from FFT(A) + FFT(B)?

断了今生、忘了曾经 提交于 2019-12-03 08:06:12
问题 I have been fighting with a very weird bug for almost a month. Asking you guys is my last hope. I wrote a program in C that integrates the 2d Cahn–Hilliard equation using the Implicit Euler (IE) scheme in Fourier (or reciprocal) space: Where the "hats" mean that we are in Fourier space: h_q(t_n+1) and h_q(t_n) are the FTs of h(x,y) at times t_n and t_(n+1), N[h_q] is the nonlinear operator applied to h_q, in Fourier space, and L_q is the linear one, again in Fourier space. I don't want to go

Shift theorem in Discrete Fourier Transform

别等时光非礼了梦想. 提交于 2019-12-03 07:58:51
I'm trying to solve a problem with python+numpy in which I've some functions of type that I need to convolve with another function . In order to optimize code, I performed the fft of f and g, I multiplied them and then I performed the inverse transformation to obtain the result. As a further optimization I realized that, thanks to the shift theorem, I could simply compute once the fft of f(x,y,z) and then multiply it by a phase factor that depends on to obtain the fft of . In particular, , where N is the length of both x and y. I tried to implement this simple formula with python+numpy, but it

How can I get DFT/FFT output frequencies in Hertz?

╄→гoц情女王★ 提交于 2019-12-03 06:23:19
问题 I want to develop musical notes detector as my degree project and I want to do it from scratch. I have written code for ".wav" file which extracts all info from that audio music file and gives me amplitude as a result. Then I have written a code for DFT - it gives me output as a complex number where one of the axis (real/imaginary) is amplitude/magnitude and other is Phase. Now the question I want the answer in frequency (in Hertz not in vector) so I can check whether my DFT gives me the

FFTW vs. OpenCV cvDFT

本小妞迷上赌 提交于 2019-12-03 03:22:57
Can I expect a speedup when using FFTW (http://www.fftw.org/) instead of OpenCV's cvDFT (http://goo.gl/YCHj0)? My program's runtime is heavily determined by the application of inverse and forward DFT and I am thinking about using FFTW instead of OpenCV cvDFT. IIRC FFTW does some kind of "runtime compilation" whereas cvDFT is a simple FFT implementation, so I guess it could speed up my processing a bit. So before I am trying it out by myself, I thought to ask in here in case anyone stumbled over the same question and solved it before. Thanks in advance I have used both (OpenCV and FFTW) and you