fft

Finding first derivative using DFT in Python

走远了吗. 提交于 2019-12-12 01:37:30
问题 I want to find the first derivative of exp(sin(x)) on the interval [0, 2/pi] using a discrete Fourier transform. The basic idea is to first evaluate the DFT of exp(sin(x)) on the given interval, giving you say v_k , followed by computing the inverse DFT of ikv_k giving you the desired answer. In reality, due to the implementations of Fourier transforms in programming languages, you might need to reorder the output somewhere and/or multiply by different factors here and there. I first did it

Selecting part of a sample by frequency

。_饼干妹妹 提交于 2019-12-12 00:03:36
问题 I'm wondering if there is a way to select part of a sample at a given frequency. The only way I can think to index the sample by frequency is using an FFT, but doing that seems to mess up the sample so that it's not actually playable anymore. I was wondering how else one might select the part of a sample at a given frequency whilst keeping the sound intelligible? Edit: The exact instructions were "synthesize an example of each vowel of pitch 150 Hz and duration 5 seconds". Edit: I completely

I did a step function FFT on matlab but only getting one side of the spectrum (0 to infinity)

女生的网名这么多〃 提交于 2019-12-11 20:11:37
问题 with this code i am only getting half og the fft spectrum from 0 to positive infinity . i am trying to mirror this along the y axis to get the other half which is symmetric to this one from 0 to negative infinity. Fs = 1000; %sampling rate Ts = 1/Fs; %sampling time interval t = -10:Ts:10-Ts; %sampling period n = length(t); %number of samples y = heaviside(t)-heaviside(t-4); %the step curve matlabFFT = figure; %create a new figure YfreqDomain = fft(y); %take the fft of our step funcion, y(t) y

FFT wrong value?

心已入冬 提交于 2019-12-11 19:40:02
问题 Randomly building a very easy sound spectrum analyzer. Given this python code: http://rosettacode.org/wiki/Fast_Fourier_transform#Python Implemented like this: import math from cmath import exp, pi def fft(x): N = len(x) if N <= 1: return x even = fft(x[0::2]) odd = fft(x[1::2]) return ([even[k] + exp(-2j * pi * k / N) * odd[k] for k in xrange(N / 2)] + [even[k] - exp(-2j * pi * k / N) * odd[k] for k in xrange(N / 2)]) #res = fft([1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0]) res = [math.sin(k) /

Compute FFT in PHP for array of numbers

放肆的年华 提交于 2019-12-11 19:08:01
问题 I have a set of array of numbers shown in the codes below. What I wanted to do is that to compute FFT in PHP on each number in the array. I followed some examples in the web http://www.phpclasses.org/package/6193-PHP-Compute-the-Fast-Fourier-Transform-of-sampled-data.html and http://www.jasonbailey.net/stuff/php-fast-fourier-transform-fft-brighton-php-october-2013/ as part of my FFT computation codes. $result_data = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); for ($index = 0;

NAudio FFT returns small and equal magnitude values for all frequencies

流过昼夜 提交于 2019-12-11 18:05:35
问题 I'm working on a project with NAudio 1.9 and I want to compute an fft for an entire song, i.e split the song in chunks of equal size and compute fft for each chunk. The problem is that NAudio FFT function returns really small and equal values for any freq in the freq spectrum. I searched for previous related posts but none seemed to help me. The code that computes FFT using NAudio: public IList<FrequencySpectrum> Fft(uint windowSize) { IList<Complex[]> timeDomainChunks = this.SplitInChunks

Use C++ FFT Code in SWIFT

那年仲夏 提交于 2019-12-11 16:59:11
问题 I have C++ FFT code (pasted below). In C++, when I input in main(), RL_Input = {1,2,-3,4}, IM_Input = {-4,3,2,1}, I get the answer as RL_Output = {4, 6, -8, 2}, IM_Output = {2, -4, -6, -8}. I want to call this C++ code from SWIFT. So, in SWIFT, I want to do something as follows: let (RL_Output, IM_Output) = Some_Swift_Function([1,2,-3,4], [-4,3,2,1]) // INPUT RL & IM print(RL_Output) print(IM_Output) // RL_Output = [4, 6, -8, 2] //Answer (REAL) // IM_Output = [2, -4, -6, -8] //Answer (IMAG)

how to know the fundamental frequency is right detected by fft/lomb-scargle?

随声附和 提交于 2019-12-11 16:31:36
问题 I am using two methods,fft and lomb-scargle, to find periods for a timing sequence points. However the fundamental frequency changes much even for the same dataset. I can get the right result only when I fine tune the sampling rate.<>br/ How to choose the parameters of the two methods to get a consistent fundamental frequency. How to know the result is reliable? 回答1: The recent "Understanding the Lomb-Scargle Periodogram - Jacob T. VanderPlas" that you can find on This link to arxiv is a very

constant lines occur in plot of fft with scipy.fftpack

不问归期 提交于 2019-12-11 13:40:05
问题 When I am computing a FFT with scipy.fftpack on a signal and plot it afterwards, I get a constant horizontal line (and a vertical line on my data) Can anyone explain why these lines occur and maybe present a solution to plot the spectrum without the lines? Let's take a look at a simple signal. Sinusoidal wave with a frequenz of 12 Hertz. In this example you can see the horizontal line at about y = 2.1 . import numpy as np import matplotlib.pyplot as plt import scipy.fftpack # test signal

FFT frequency of sound

让人想犯罪 __ 提交于 2019-12-11 12:55:09
问题 On microphone at some time, starts flowing sound defined frequency(500hz). How do I know when the signal began to come to the microphone? To solve this problem, I know that I need to use FFT(Fast Fourier transform). But I dont understand, how should I take after FFT frequency? I'm use NAudio on C#. And my buffer from microphone is byte array. 回答1: Using an FFT for this is overkill and not particularly appropriate. A much simpler solution for this kind of problem (tone detection/onset