fft

Creating an iPhone music Visualiser based on Fourier Transform

左心房为你撑大大i 提交于 2019-12-20 10:55:03
问题 I am designing a music visualiser application for the iPhone. I was thinking of doing this by picking up data via the iPhone's mic, running a Fourier Transform on it and then creating visualisations. The best example I have been able to get of this is aurioTuch which produces a perfect graph based on FFT data. However I have been struggling to understand / replicate aurioTouch in my own project. I am unable to understand where exactly aurioTouch picks up the data from the microphone before it

Scipy : fourier transform of a few selected frequencies

删除回忆录丶 提交于 2019-12-20 09:45:18
问题 I am using scipy.fft on a signal, with a moving window to plot the amplitudes of frequencies changing with time (here is an example, time is on X, frequency on Y, and amplitude is the color). However, only a few frequencies interest me (~3, 4 frequencies only). With FFTs it seems like I can't select only the frequencies I want (cause apparently the range of frequencies is determined by the algorithm), so I calculate a lot of useless stuff, and my program even crashes with a MemoryError if the

WAV-file analysis C (libsndfile, fftw3)

南笙酒味 提交于 2019-12-20 09:42:52
问题 I'm trying to develop a simple C application that can give a value from 0-100 at a certain frequency range at a given timestamp in a WAV-file. Example: I have frequency range of 44.1kHz (typical MP3 file) and I want to split that range into n amount of ranges (starting from 0). I then need to get the amplitude of each range, being from 0 to 100. What I've managed so far: Using libsndfile I'm now able to read the data of a WAV-file. infile = sf_open(argv [1], SFM_READ, &sfinfo); float samples

Safe and fast FFT

亡梦爱人 提交于 2019-12-20 09:38:06
问题 Inspired by Herb Sutter's compelling lecture Not your father's C++, I decided to take another look at the latest version of C++ using Microsoft's Visual Studio 2010. I was particularly interested by Herb's assertion that C++ is "safe and fast" because I write a lot of performance-critical code. As a benchmark, I decided to try to write the same simple FFT algorithm in a variety of languages. I came up with the following C++11 code that uses the built-in complex type and vector collection:

How to catch the event when spectrum of an audio reached a specific height, like triggered event made by a loud sound?

我与影子孤独终老i 提交于 2019-12-20 07:22:14
问题 I already have the program of the player, wave form generator, spectrum analyzer, the list box where the time will be recorded. These stuffs are working. Now, I want to add the feature, when you will play the audio file, and it reached the certain threshold or the max peak of the spectrum, the time of that current event will be recorded to the list box. I managed to add time in the list box so now, my only problem is how to detect the event. I used FFT in the spectrum analyzer, but I;m stuck

Inverse fast fourier transform in MATLAB

瘦欲@ 提交于 2019-12-20 05:39:20
问题 My MATLAB code for fft and ifft below has a problem with the inverse Fourier signal y not matching the in put signal x . Is there any solution to resolve this? N = 1000; t0 = 1e-13; tau = 2*1e-14; n = [0:t0/40:2*1e-13-t0/40]; f0 = 3*1e8/(150*1e-9); x = cos(2*pi*f0*n); x = x.*exp((-(n-t0).^2)./(tau^2)); X = abs(fft(x,N)); F = [-N/2 : N/2 - 1]/N; X = fftshift(X); y=ifft(X,80); figure(3) plot(n,y) 回答1: I see a number of issues here: N = 1000; t0 = 1e-13; tau = 2*1e-14; n = [0:t0/40:2*1e-13-t0/40

Calculate Frequency from sound input using FFT

杀马特。学长 韩版系。学妹 提交于 2019-12-20 04:55:33
问题 My app. is displaying the peak frequency of input sound in RPM .. i have array of doubles contains the samples in time domain. audioRecord.read(buffer, 0, 1024); Then i did FFT on it . transformer.ft(toTransform); using this class Here then i got the max magnitude of complex values which are the results of FFT // block size = 1024 double magnitude[] = new double[blockSize / 2]; for (int i = 0; i < magnitude.length; i++) { double R = toTransform[2 * i] * toTransform[2 * i]; double I =

Calculating audio pitch in MATLAB?

僤鯓⒐⒋嵵緔 提交于 2019-12-20 04:52:22
问题 Yesterday I finalised the code for detecting the audio energy of a track displayed over time, which I will eventually use as part of my audio thumbnailing project. However I would also like a method that can detect the pitch of a track displayed over time, so I have 2 options from which to base my research upon. [y, fs, nb] = wavread('Three.wav'); %# Load the signal into variable y frameWidth = 441; %# 10 msec numSamples = length(y); %# Number of samples in y numFrames = floor(numSamples

record audio in java and determine real time if a tone of x frequency was played if so do something

爷,独闯天下 提交于 2019-12-20 04:49:15
问题 I want to be able to detect a tone of a predetermined frequency using java. What I am doing is playing a tone (the frequency of the tone is variable by user input) and I am trying to detect if the tone is of a certain frequency. If it is, I execute a certain method. From what I have read I will need to us FFT, but I'm not sure how to implement it in java. There seems to be a lot of documentation for how to do it, but what documentation there is involves looking at an audio file rather than

Correct frequency axis using FFT

笑着哭i 提交于 2019-12-20 04:35:48
问题 How can I get the correct frequency vector to plot using the FFT of MATLAB ? My problem: N = 64; n = 0:N-1; phi1 = 2*(rand-0.5)*pi; omega1 = pi/6; phi2 = 2*(rand-0.5)*pi; omega2 = 5*pi/6; w = randn(1,N); % noise x = 2*exp(1i*(n*omega1+phi1))+4*sin(n*omega2+phi2); h = rectwin(N).'; x = x.*h; X = abs(fft(x)); Normally I'd do this : f = f = Fs/Nsamples*(0:Nsamples/2-1); % Prepare freq data for plot The problem is this time I do not have a Fs (sample frequency). How can I do it correctly in this