spectrum

Matlab FFT and home brewed FFT

拟墨画扇 提交于 2019-12-04 05:15:52
问题 I'm trying to verify an FFT algorithm I should use for a project VS the same thing on Matlab. The point is that with my own C FFT function I always get the right (the second one) part of the double sided FFT spectrum evaluated in Matlab and not the first one as "expected". For instance if my third bin is in the form a+i*b the third bin of Matlab's FFT is a-i*b. A and b values are the same but i always get the complex conjugate of Matlab's. I know that in terms of amplitudes and power there's

How to draw a frequency spectrum from a Fourier transform

≡放荡痞女 提交于 2019-12-03 20:31:35
I want to plot the frequency spectrum of a music file (like they do for example in Audacity). Hence I want the frequency in Hertz on the x-axis and the amplitude (or desibel) on the y-axis. I devide the song (about 20 million samples) into blocks of 4096 samples at a time. These blocks will result in 2049 (N/2 + 1) complex numbers (sine and cosine -> real and imaginary part). So now I have these thousands of individual 2049-arrays, how do I combine them? Lets say I do the FFT 5000 times resulting in 5000 2049-arrays of complex numbers. Do I plus all the values of the 5000 arrays and then take

Sorting a list of RGB triplets into a spectrum

左心房为你撑大大i 提交于 2019-12-03 15:43:46
问题 I have a list of RGB triplets, and I'd like to plot them in such a way that they form something like a spectrum. I've converted them to HSV, which people seem to recommend. from PIL import Image, ImageDraw import colorsys def make_rainbow_rgb(colors, width, height): """colors is an array of RGB tuples, with values between 0 and 255""" img = Image.new("RGBA", (width, height)) canvas = ImageDraw.Draw(img) def hsl(x): to_float = lambda x : x / 255.0 (r, g, b) = map(to_float, x) h, s, l =

Sorting a list of RGB triplets into a spectrum

▼魔方 西西 提交于 2019-12-03 05:12:39
I have a list of RGB triplets, and I'd like to plot them in such a way that they form something like a spectrum. I've converted them to HSV, which people seem to recommend. from PIL import Image, ImageDraw import colorsys def make_rainbow_rgb(colors, width, height): """colors is an array of RGB tuples, with values between 0 and 255""" img = Image.new("RGBA", (width, height)) canvas = ImageDraw.Draw(img) def hsl(x): to_float = lambda x : x / 255.0 (r, g, b) = map(to_float, x) h, s, l = colorsys.rgb_to_hsv(r,g,b) h = h if 0 < h else 1 # 0 -> 1 return h, s, l rainbow = sorted(colors, key=hsl) dx

iOS FFT Accerelate.framework draw spectrum during playback

五迷三道 提交于 2019-12-03 03:25:37
问题 UPDATE 2016-03-15 Please take a look at this project: https://github.com/ooper-shlab/aurioTouch2.0-Swift. It has been ported to Swift and contains every answer you're looking for, if you cam here. I did a lot of research and learned a lot about FFT and the Accelerate Framework. But after days of experiments I'm kind of frustrated. I want to display the frequency spectrum of an audio file during playback in a diagram. For every time interval it should show the magnitude in db on the Y-axis

iOS FFT Draw spectrum

寵の児 提交于 2019-12-03 03:20:08
问题 I've read these question: Using the Apple FFT and Accelerate Framework How do I set up a buffer when doing an FFT using the Accelerate framework? iOS FFT Accerelate.framework draw spectrum during playback They all describe how to setup fft with the accelerate framework. With their help I was able to setup fft and get a basic spectrum analyzer. Right now, I'm displaying all values I got from the fft. However, I only want to show 10-15, or a variable number, of bars respreseting certain

iOS FFT Draw spectrum

左心房为你撑大大i 提交于 2019-12-02 16:52:16
I've read these question: Using the Apple FFT and Accelerate Framework How do I set up a buffer when doing an FFT using the Accelerate framework? iOS FFT Accerelate.framework draw spectrum during playback They all describe how to setup fft with the accelerate framework. With their help I was able to setup fft and get a basic spectrum analyzer. Right now, I'm displaying all values I got from the fft. However, I only want to show 10-15, or a variable number, of bars respreseting certain frequencies. Just like the iTunes or WinAmp Level Meter. 1. Do I need to average magnitude values from a range

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

无人久伴 提交于 2019-12-02 09:36:09
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 on this. How can I do this using my current resources like FFT, waveform generator, spectrum analyzer,

Matlab FFT and home brewed FFT

半世苍凉 提交于 2019-12-02 04:25:37
I'm trying to verify an FFT algorithm I should use for a project VS the same thing on Matlab. The point is that with my own C FFT function I always get the right (the second one) part of the double sided FFT spectrum evaluated in Matlab and not the first one as "expected". For instance if my third bin is in the form a+i*b the third bin of Matlab's FFT is a-i*b. A and b values are the same but i always get the complex conjugate of Matlab's. I know that in terms of amplitudes and power there's no trouble (cause abs value) but I wonder if in terms of phases I'm going to read always wrong angles.

In Matlab, how to draw lines from the curve to specific xaxis position?

社会主义新天地 提交于 2019-12-02 03:51:35
I have a spectral data (1000 variables on xaxis, and peak intensities as y) and a list of peaks of interest at various specific x locations (a matrix called Peak) which I obtained from a function I made. Here, I would like to draw a line from the maximum value of each peaks to the xaxis - or, eventually, place a vertical arrow above each peaks but I read it is quite troublesome, so just a vertical line is welcome. However, using the following code, I get "Error using line Value must be a vector of numeric type". Any thoughts? X = spectra; [Peak,intensity]=PeakDetection(X); nrow = length(Peak);