fft

Gfortran complex actual to real dummy argument

左心房为你撑大大i 提交于 2019-12-20 04:27:10
问题 I am trying to use fftpack with gfortran, but I am getting errors that i think relate to that some routines are passed complex arrays when the dummy argument is declared as real. I read a comment on an intel fortran page that one could disable " check routine interface ". Does anyone know if there is a similar option for gfortran? I would like to not have to edit the fftpack... ( i guess this is because complex in memory is represented by two reals and the array arguments are passed as

How can I do real-time pitch detection in .Net?

随声附和 提交于 2019-12-20 02:54:49
问题 I want to make a program that detects the note that is being played in front of the microphone. I am testing the FFT function of Naudio, but with the tests that I did in audacity it seems that FFT does not detect the pitch correctly. I played an C5, but the highest pick was at E7. I changed the first dropdown box in the frequency analysis window to "enchanced autocorrelation" and after that the highest pick was at C5. I googled "enchanced autocorrelation" and had no luck. 回答1: The highest

DFT result in Swift is different than that of MATLAB

巧了我就是萌 提交于 2019-12-20 02:34:40
问题 import Cocoa import Accelerate let filePath = Bundle.main.path(forResource: "sinusoid", ofType: "txt") let contentData = FileManager.default.contents(atPath: filePath!) var content = NSString(data: contentData!, encoding: String.Encoding.utf8.rawValue) as? String var idx = content?.characters.index(of: "\n") idx = content?.index(after: idx!) repeat { //let fromIndex = index(from: ) content = content?.substring(from: idx!) idx = content?.characters.index(of: "\n") idx = content?.index(after:

Using Apple's Accelerate framework, FFT, Hann windowing and Overlapping

巧了我就是萌 提交于 2019-12-20 02:29:05
问题 I'm trying to setup FFT for a project and really didn't get a clear picture on things... Basically, I am using Audio Units to get the data from the device's microphone. I then want to do FFT on that data. This is what I understand so far: I need to setup a circular buffer for my data. On each filled buffer, I apply a Hann window then do an FFT . However, I still need some help on overlapping. To get more precise results, I understand I need to use this expecially since I am using windowing.

FFT\\NTT总结

允我心安 提交于 2019-12-19 13:16:02
学了好久,终于基本弄明白了 推荐两个博客: 戳我 戳我 再推荐几本书: 《ACM/ICPC算法基础训练教程》 《组合数学》(清华大学出版社) 《高中数学选修》 预备知识 复数方面 找数学老师去 \[i^{2}=-1,i为虚数的单位\] 坐标系上纵轴就是虚数轴,复数就是这上面的点 三种表示法: \[一般:a + bi,a为实部,b为虚部\] \[指数:e^{i\theta}*坐标系上的模长\] \[三角:模长*(cos\theta + i sin \theta)\] 运算: 加减法:实部虚部分别相加 乘法: \[(a + bi) * (c + di) = ac + adi + bci + bdi^{2} = ac-bd+(ad+bc)i\] 欧拉公式 \[e^{ix} = cosx + isinx(就是指数表示和三角表示)\] \[特别的e^{i\pi} = -1\] 多项式 \[系数表示法:A(x) = \Sigma _{k=0}^{n - 1} a_kx^k\] \[点值表示法:对于所有的x_k,求出它们对应的A(x),设为y_k\] \[则可以用\{(x_0, y_0), (x_1, y_1), ......, (x_n-1, y_n-1)\} 表示这个多项式 并且是唯一确定的\] 单位复数根 \[n次单位复数根\omega^{n} = 1,n次单位复数根刚好有n个对应e^{

Low-pass filtering a color image using the FFT and IFFT

久未见 提交于 2019-12-19 09:07:00
问题 I am trying to apply the FFT on the color images. I extract the three components: red, green and blue then I apply fft2 to each one separately then I applied a Gaussian filter in each plane. Now I am trying to show the red, green and blue components after blurred. After, I apply ifft2 to get the result. My problem is I see a gray image in each component. I am trying to show just the color planes alone but my code does not work. In addition, I want to combine these three components together to

How do I plot the spectrum of a wav file using FFT?

*爱你&永不变心* 提交于 2019-12-19 06:55:50
问题 NOTE: This is not a duplicate, I have specific requirements other than related questions. To start with, I want to plot the spectrum of an audio file (.wav) just like what audacity does (similar: How to draw a frequency spectrum from a Fourier transform). So far I am able to read and write wav files. But my problem is I don't know exactly what values I need to pass to the FFT function. By the way I am using Exocortex for FFT in C#. The FFT function requires me to pass an array of complex

Find period of a signal out of the FFT

一世执手 提交于 2019-12-19 04:10:33
问题 I have a periodic signal I would like to find the period. Since there is border effect, I first cut out the border and keep N periods by looking at the first and last minima. Then, I compute the FFT. Code: import numpy as np from matplotlib import pyplot as plt # The list of a periodic something L = [2.762, 2.762, 1.508, 2.758, 2.765, 2.765, 2.761, 1.507, 2.757, 2.757, 2.764, 2.764, 1.512, 2.76, 2.766, 2.766, 2.763, 1.51, 2.759, 2.759, 2.765, 2.765, 1.514, 2.761, 2.758, 2.758, 2.764, 1.513, 2

Find period of a signal out of the FFT

风格不统一 提交于 2019-12-19 04:10:12
问题 I have a periodic signal I would like to find the period. Since there is border effect, I first cut out the border and keep N periods by looking at the first and last minima. Then, I compute the FFT. Code: import numpy as np from matplotlib import pyplot as plt # The list of a periodic something L = [2.762, 2.762, 1.508, 2.758, 2.765, 2.765, 2.761, 1.507, 2.757, 2.757, 2.764, 2.764, 1.512, 2.76, 2.766, 2.766, 2.763, 1.51, 2.759, 2.759, 2.765, 2.765, 1.514, 2.761, 2.758, 2.758, 2.764, 1.513, 2

What is numpy.fft.rfft and numpy.fft.irfft and its equivalent code in MATLAB

只愿长相守 提交于 2019-12-19 04:04:12
问题 I am converting a python code into MATLAB and one of the code uses numpy rfft. In the documentation of numpy, it says real input. Compute the one-dimensional discrete Fourier Transform for real input. So what I did in MATLAB is using abs but the results are different. Python code ffta = np.fft.rfft(a) MATLAB code ffta = abs(fft(a)); What have I misunderstood? 回答1: The real FFT in numpy uses the fact that the fourier transform of a real valued function is so to say "skew-symmetric", that is