signal-processing

FFT and accelerometer data: why am I getting this output?

给你一囗甜甜゛ 提交于 2019-12-04 02:27:31
问题 I have read various posts here at StackOverflow regarding the execution of FFT on accelerometer data, but none of them helped me understand my problem. I am executing this FFT implementation on my accelerometer data array in the following way: int length = data.size(); double[] re = new double[256]; double[] im = new double[256]; for (int i = 0; i < length; i++) { input[i] = data[i]; } FFT fft = new FFT(256); fft.fft(re, im); float outputData[] = new float[256]; for (int i = 0; i < 128; i++)

Plotting the magnitude and phase spectra of a wav file in the range of -fs/2 to fs/2

耗尽温柔 提交于 2019-12-04 02:15:36
问题 I'm having problems plotting the FFT of a wav file. I managed to plot the magnitude and phase spectrums of the signal, however I need to repeat this in range -fs/2:fs/2 . %read sound files %'y' is the vector holding the original samples & 'fs' refers to the sampling frequency [y,fs] = wavread('handel.wav'); ydft = fft(y); %fft to transform the original signal into frequency domain n = length (y); %length of the original signal % y has even length ydft = ydft(1:length(y)/2+1); % create a

Where can I find good tutorials on writing audio DSP filters (lowpass, etc)? [closed]

筅森魡賤 提交于 2019-12-03 21:49:12
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I've recently become very interested in learning how to implement various audio filters in AS3. By intuitive guessing (and inspired by

Detect major events in signal data?

女生的网名这么多〃 提交于 2019-12-03 21:45:57
If I have a signal as the one below, how would I go about finding the beginning and end of the two "major events" (illustrated by a green arrow where the event begins, and a red arrow where it ends)? I've tried the method suggested in this answer , but it seems that no matter how much I play around with the lag , threshold and influence variables, it either reacts to the tiny changes in the beginning, middle and end of the graph (where there are no major events), or it doesn't react at all. I can't simply determine if the signal is above a fixed threshold, as the strength of the signal can

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

Speaker Recognition using MARF

笑着哭i 提交于 2019-12-03 17:05:33
I am using MARF(Modular Audio Recognition Framework) to recognize the Speaker's voice. In this, i have trained MARF with the voice of person 'A' and tested MARF with voice of person 'B'. Trained using --train training-samples Tested using --ident testing-samples/G.wav In my speakers.txt file I have mentioned the voice samples of both the persons i.e. A & B. But I am not getting the correct response means both the trained voice and testing voice are different but MARF is giving the Audio Sampled match. I have gone through this link too.. http://stackoverflow.com/questions/4837511/speaker

FFT normalization

牧云@^-^@ 提交于 2019-12-03 16:58:24
I know this question has been asked ad nauseam but somehow I can't make it work properly. I created a single, sine wave of 440 Hz having a unit amplitude. Now, after the FFT, the bin at 440 Hz has a distinct peak but the value just isn't right. I'd expect to see 0 dB since I'm dealing with a unit amplitude sine wave. Instead, the power calculated is well above 0 dB. The formula I'm using is simply for (int i = 0; i < N/2; i++) { mag = sqrt((Real[i]*Real[i] + Img[i]*Img[i])/(N*0.54)); //0.54 correction for a Hamming Window Mag[i] = 10 * log(mag) ; } I should probably point out that the total

DCT Compression - Block Size, Choosing Coefficients

冷暖自知 提交于 2019-12-03 16:48:11
I'm trying to understand the effect of the Block Size and best strategy of choosing the Coefficients in DCT compression. Basically I want to ask what I wrote here: Video Compression: What is discrete cosine transform? Lets assume the most primitive compression. Making block of an image. Performing a DCT on each blog and zeroing out some coefficients. To my understanding, the smaller the block the better. Smaller blocks means the Pixels are more correlated hence the energy in the DCT spectrum is more "Compact". It should be more emphasized in a fast varying images (High Frequency). Let's say we

Reimplement vDSP_deq22 for Biquad IIR Filter by hand

一曲冷凌霜 提交于 2019-12-03 16:46:28
I'm porting a filterbank that currently uses the Apple-specific (Accelerate) vDSP function vDSP_deq22 to Android (where Accelerate is not available). The filterbank is a set of bandpass filters that each return the RMS magnitude for their respective band. Currently the code (ObjectiveC++, adapted from NVDSP) looks like this: - (float) filterContiguousData: (float *)data numFrames:(UInt32)numFrames channel:(UInt32)channel { // Init float to store RMS volume float rmsVolume = 0.0f; // Provide buffer for processing float tInputBuffer[numFrames + 2]; float tOutputBuffer[numFrames + 2]; // Copy the

Result from processing audio signal with Goertzel algorithm

梦想与她 提交于 2019-12-03 16:26:48
I made a little signal processing app. It processes audio signal (morse code) on certain frequency with Goerztel algorithm. Application saves temporary file to the filesystem and after recording is finished, starts to detect signals. Now I got the result with bunch of magnitudes. I don't really know what to read from those magnitudes. How can I decode the morse code from those magnitudes? How can I read them? Tried to find references, but nowhere is explained what is the result and how to read it. EDIT: My morse code application is made with Delphi and uses Windows Beep function to send