signal-processing

Signal enhancing algorithm

醉酒当歌 提交于 2020-01-07 02:51:30
问题 I need an algorithm (preferable in a Pascal-like language, but it the end doesn't really matter) that will make the "signal" (actually a series of data points) in left look like the one in right. Signal origin: The signal is generated by a machine. Oversimplifying the explanation, the machine is measuring the density of a liquid flowing through a transparent tube. So, the signal is nothing similar to an electrical signal (audio/radio frequency). The data points could look like this: [1, 2, 1,

Real-time impulse response convolution with FFTW — result sounds like IR is symmetrical

回眸只為那壹抹淺笑 提交于 2020-01-06 20:01:58
问题 For research purposes I am building a real-time reverb convolution engine in C++ using FFTW (and PortAudio for the sound delivery) with the overlap-add method for convolution. Most of it is working, but a very peculiar effect occurs. Though I can't see why, it sounds very much as if the impulse response becomes symmetrical: what was h[n] becomes h[n] + h[-n] . Does anyone know if performing FFT in the way I describe below would have this effect? Basically, my process is as follows: Known in

How can i plot the sum of two discrete signal?

ε祈祈猫儿з 提交于 2020-01-06 16:21:10
问题 I have a discrete signal x = [ 1 2 3 4 5 6 ] with n = [ -2 -1 0 1 2 3 ] How can i plot y[n] = x[n-1] + x[n-2] + x[n] ? Thanks. 回答1: You can do the following: y = x(1:end-2) + x(2:end-1) + x(3:end); plot(n(3:end), y) 回答2: This looks like a filter... You should consider using the filter function to calculate y : x = [...whatever...]; % Filter coefficients from your difference equation. b = [1 1 1]; a = 1; y = filter(b, a, x); plot(n, y); This will handle initial conditions more appropriately

How can i plot the sum of two discrete signal?

醉酒当歌 提交于 2020-01-06 16:21:00
问题 I have a discrete signal x = [ 1 2 3 4 5 6 ] with n = [ -2 -1 0 1 2 3 ] How can i plot y[n] = x[n-1] + x[n-2] + x[n] ? Thanks. 回答1: You can do the following: y = x(1:end-2) + x(2:end-1) + x(3:end); plot(n(3:end), y) 回答2: This looks like a filter... You should consider using the filter function to calculate y : x = [...whatever...]; % Filter coefficients from your difference equation. b = [1 1 1]; a = 1; y = filter(b, a, x); plot(n, y); This will handle initial conditions more appropriately

comparing filtered data3: filtData (bandpass) vs filtfilt with filter object vs filfilt with sos matrix

强颜欢笑 提交于 2020-01-06 05:35:10
问题 new attempt to understand this. I'm trying to get what bandpass matlab function does. So digging into the m-files, the filter object is constructed with: opts=signal.internal.filteringfcns.parseAndValidateInputs(x,'bandpass',var); opts = designFilter(opts); Then, the filtering is done with: y = signal.internal.filteringfcns.filterData(x,opts); Then going into the filterData function, the actual filtering is done with: y = filtfilt(opts.FilterObject,x); because it is an IIR filter. Now, if I

generate signal with seasonal and diurnal component

社会主义新天地 提交于 2020-01-06 03:57:49
问题 This is a rather vague question but here we go - I would like to generate a time series for hourly measurements of one year, so for 2011 ti would 8760 values within the series. To make it easier to understand what I am trying to do I will use a real world example: If we had a time series of hourly air temperature measurements an then plotted the entire series it would look similar to a bell shaped curve i.e. a = 0; b = 30; x = a + (b-a) * rand(1, 8760); m = (a + b)/2; s = 12; p1 = -.5 * ((x -

Precise tone onset/duration measurement?

老子叫甜甜 提交于 2020-01-05 11:14:16
问题 I have a working tone detector which uses an FFT to determine whether a tone (or tone pair) of a particular frequency is present in an audio stream (if sufficiently above the noise floor). What method could I use to more precisely locate the onset time and duration of that tone? I am looking for something far more precise than the FFT frame duration (about 50 ms). The tone is assumed to be much longer than an FFT frame. 回答1: If the particular frequency is known ahead of time, you could design

Baseline correction for spectroscopic data

一笑奈何 提交于 2020-01-05 04:40:11
问题 I am working with Raman spectra, which often have a baseline superimposed with the actual information I am interested in. I therefore would like to estimate the baseline contribution. For this purpose, I implemented a solution from this question. I do like the solution described there, and the code given works fine on my data. A typical result for calculated data looks like this with the red and orange line being the baseline estimates: Typical result of baseline estimation with calculated

C99 equivalent to MATLAB “filter”?

我是研究僧i 提交于 2020-01-05 04:28:11
问题 Why do the MATLAB and C versions produce different results? MATLAB: [B_coeffs, A_coeffs ] = butter(4, 100/(16000/2), 'high'); state = zeros( 4, 1 ); input = zeros( 64,1 ); for i=1:64 input(i)=i; end [filtered_output, state] = filter( B_coeffs, A_coeffs, input, state ); C: int main(...) { for(int test=0; test<64;test++) Xin[test]=test+1; ... high_pass_filter_init(...) high_pass_filter_do(...) } // Do the filtering void high_pass_filter_do( t_high_pass_filter* hpf, float *Xin, float *Yout ) {

Error while importing scikits.talkbox

你说的曾经没有我的故事 提交于 2020-01-04 09:07:16
问题 I want to use scikits.talkbox, but i get the following error while import scikits.talkbox. Traceback (most recent call last): File "/home/seref/Desktop/machine learning codes/MFCC/main.py", line 3, in from scikits.talkbox.features.mfcc import mfcc File "/usr/local/lib/python3.5/dist-packages/scikits/talkbox/ init .py", line 3, in from tools import * ImportError: No module named 'tools' code sample import scipy.io.wavfile from scikits.talkbox.features.mfcc import mfcc sample_rate, X = scipy.io