signal-processing

Streaming Data to Sound Card Using C on Windows [closed]

痴心易碎 提交于 2019-12-06 08:10:30
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . As part of a university project I have to do some signal processing and would like to output the results using the PC sound card. The software has to be written in C and needs to work with Windows (preferably 7 and XP). I have found code examples for outputting .wav and similar files, but I am interested in continuously outputting data rather than outputting from files. It is likely that the data for output will

How to compute decibel (dB) of Amplitude from Media Player?

假如想象 提交于 2019-12-06 07:31:23
问题 I have a code to compute real-time dB Amplitude of AudioRecord. The code works well for computing dB Amplitude. After recording, I save that it to wav file. Now, I want to playback that file and recompute the dB Amplitude. However, I cannot achieve similar result before. Could you help me to fix it. This is my code to compute dB Amplitude when recording and playback. 1.Compute dB amplitude when recording bufferSize = AudioRecord.getMinBufferSize(16000, AudioFormat.CHANNEL_IN_MONO, AudioFormat

Autocorrelation returns random results with mic input (using a high pass filter)

怎甘沉沦 提交于 2019-12-06 07:21:46
Sorry to ask a similar question to the one i asked before ( FFT Problem (Returns random results) ), but i've looked up pitch detection and autocorrelation and have found some code for pitch detection using autocorrelation. Im trying to do pitch detection of a users singing. Problem is, it keeps returning random results. I've got some code from http://code.google.com/p/yaalp/ which i've converted to C++ and modified (below). My sample rate is 2048, and data size is 1024. I'm detecting pitch of both a sine wave and mic input. The frequency of the sine wave is 726.0, and its detecting it to be

Need help with peak signal detection in Perl

时光毁灭记忆、已成空白 提交于 2019-12-06 07:16:49
问题 Hi everyone I have some values of intensities from images of yeast colony plates. I need to be able to find the peak values from the intensity values. Below is an example image showing how the values look when graphed. Example of some of the values 5.7 5.3 8.2 16.5 34.2 58.8 **75.4** 75 65.9 62.6 58.6 66.4 71.4 53.5 40.5 26.8 14.2 8.6 5.9 7.7 14.9 30.5 49.9 69.1 **75.3** 69.8 58.8 57.2 56.3 67.1 69 45.1 27.6 13.4 8 5 These values show two peaks at 75.4 and 75.3, you can see that the values

How do I scale an FFT-based cross-correlation such that its peak is equal to Pearson's rho

若如初见. 提交于 2019-12-06 07:02:46
Description of the problem FFT can be used to compute cross-correlation between two signals or images. To determine the delay or lag between two signals A and B , it suffices to locate the peak of: IFFT(FFT(A)*conjugate(FFT(B))) However, the amplitude of the peak is related to the amplitude of the frequency spectra of the individual signals. Thus to determine the Pearson correlation (rho) , the amplitude of this peak must be scaled by the total energy in the two signals. One way to do this is to normalize by the geometric mean of the individual autocorrelations . This gives a reasonable

Help with resampling/upsampling

限于喜欢 提交于 2019-12-06 06:30:42
问题 I have an array of 240 data points sampled at 600hz, representing 400ms. I need to resample this data to 512 data points sampled at 1024hz, representing 500ms. I assume since I'm starting with 400ms of data, the last 100ms will just need to be padded with 0s. Is there a best approach to take to accomplish this? 回答1: If you want to avoid interpolation then you need to upsample to a 76.8 kHz sample rate (i.e. insert 127 0s after every input sample), low pass filter, then decimate (drop 74 out

EEG raw data band filtering using matlab

末鹿安然 提交于 2019-12-06 06:30:30
问题 I have some raw EEG data in csv files captured using Emotiv EPOC as part of experiments I am doing for my undergrad thesis. I uploaded one of the files here for reference. I wish to perform band pass filtering on the data in the certain bands delta (1-4Hz) theta (4-8Hz) alpha (8-13Hz) beta (13-30Hz) and gamma (36- 40Hz) As I am relatively new in Matlab, how can I do that? I am aware that similar questions already exist but they do not apply in my case as I am using Emotiv EPOC for EEG data

QRS detection(peaks) of a raw ecg signal in matlab

十年热恋 提交于 2019-12-06 06:15:18
I want to find the peaks of the raw ecg signal so that I can calculate the beats per minute(bpm). I Have written a code in matlab which I have attached below.In the code below I am unable to find threshold point correctly which will help me in finding the peaks and hence the bpm. %input the signal into matlab [x,fs]=wavread('heartbeat.wav'); subplot(2,1,1) plot(x(1:10000),'r-') grid on %lowpass filter the input signal with cutoff at 100hz h=fir1(30,0.3126); %normalized cutoff freq=0.3126 y=filter(h,1,x); subplot(2,1,2) plot(y(1:10000),'b-') grid on % peaks are seen as pulses(heart beats) beat

Why does FFT accelerate the calculation involved in convolution?

被刻印的时光 ゝ 提交于 2019-12-06 06:07:25
问题 I am seeing a lot of literature in which they say that by using the fft one can reach a faster convolution. I know that one needs to get fft and and then ifft from the results, but I really do not understand why using the fft can make the convolution faster? 回答1: FFT speeds up convolution for large enough filters, because convolution requires N multiplications (and N-1) additions for each output sample and conversely (2)N^2 operations for a block of N samples. Taking account, that one has to

Explanation of Interpolate Hermite method

旧巷老猫 提交于 2019-12-06 05:54:55
I've currently got this bounty running on how to resample audio data with the intention of increasing the pitch . Many solutions have been made and I have to admit I'm feeling a bit overwhelmed by the choices and information. I was directed to this solution and found this chunk of code: public static float InterpolateCubic(float x0, float x1, float x2, float x3, float t) { float a0, a1, a2, a3; a0 = x3 - x2 - x0 + x1; a1 = x0 - x1 - a0; a2 = x2 - x0; a3 = x1; return (a0 * (t * t * t)) + (a1 * (t * t)) + (a2 * t) + (a3); } public static float InterpolateHermite4pt3oX(float x0, float x1, float