Questions tagged [moving-average]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
18
votes
2answers
37k views

What is the cut-off frequency of a moving average filter?

I need to design a moving average filter that has a cut-off frequency of 7.8 Hz. I have used moving average filters before, but as far as I'm aware, the only parameter that can be fed in is the number ...
10
votes
4answers
5k views

How should a moving average handle missing data points?

I'm writing a program that averages the user's weight across different days. I'm planning to use a 5-point moving-average (current day, two before and two after). Sometimes, a data point is missing ...
7
votes
1answer
407 views

“Ensemble averaging … cannot track dynamic changes”?

A book claims this as a motivation for introducing exponential averaging: A disadvantage of ensemble averaging is that the resulting estimate cannot track dynamic changes occurring in the observed ...
6
votes
3answers
16k views

Moving average vs. Moving median

I have read in many places that Moving median is a bit better than Moving average for some applications, because it is less sensitive to outliers. I wanted to test this assertion on real data, but I ...
5
votes
6answers
340 views

Optimal $ n $ -th Order IIR /AR Approximation of a Moving Average Filter

I would like to approximate a moving average filter with an IIR filter of much lower order than the tap-length of the moving average filter. Optimality shall refer to the $L_2$ norm of the impulse ...
5
votes
5answers
40k views

How to implement a moving average in C without a buffer?

Is it possible to implement a moving average in C without the need for a window of samples? I've found that I can optimize a bit, by choosing a window size that's a power of two to allow for bit-...
5
votes
1answer
2k views

How to decide whether to use AR or MA for smoothing data?

Imagine I've got some offline data that I want to smooth. I could use an auto-regressive or moving-average filter of some appropriate order for conducting the smoothing. On which criteria should I ...
5
votes
1answer
217 views

Model validation after estimation — system identification — help with an example in Matlab

QUESTION: I want to determine how well the estimated model fits to the future new data. How do I validate the estimated model...what is the procedure? After system identification, how to do model ...
4
votes
1answer
1k views

How does this “simple filter” work?

I'm new to DSP, and I'm using this basic "1-pole LPF" Param Smooth filter which "smooth" param when I change it. The code is pretty simple: ...
4
votes
1answer
1k views

How can I smoothly interpolate between 2 position?

I've got a 1D signal (position of a servo motor over time) and I've extracted 'peaks'/'key' positions picking running average "local extrema" points. Below is are 2 plots from 2 servos and the white ...
4
votes
1answer
2k views

Difference between Gaussian and moving average filters for peak detection and doppler shift detection?

Consider having a signal in the time domain, and you want to smooth the signal. Moving average and Gaussian filters that are used. How do you choose which is used for what? What are the conditions ...
4
votes
1answer
120 views

Underdetermined deconvolution of windowed output

Consider a discrete 'blurred' output $h[t]$ given by the convolution of filter $f[t]$ and signal $g[t]$. This question considers recovering $g[t]$ from a window (subset) of $h[t]$. This causes the ...
4
votes
1answer
2k views

Lowpass : What is wrong with average filtering?

The question is : What is wrong with averaging as low pass filter ? The details : I want to lowpass filter a signal to downsample it. The constraints are : I have no RAM available and I work in ...
4
votes
2answers
258 views

Frequency response of a rolling linear regression

I am looking for a way to characterise the frequency response of the slope from a linear regression. We are exploring the effect of window length of the regression to the magnitude of the slope of the ...
3
votes
4answers
700 views

Is there an algorithm for second order filtering of data where the filter frequency is not known a priori?

It is well known that a moving average algorithm done in the time domain is equivalent to a filter with frequency response $\mathrm{sinc}(\omega\tau)$ where $\tau$ is the averaging time. (see this ...
3
votes
1answer
1k views

Equivalent 2D mask of moving-average

I have the moving-average mask as mask = [1 1 1; 1 1 1; 1 1 1]; and then I compute the convolution 3 times ...
3
votes
5answers
3k views

What is the transfer function of a moving average?

To make post-processing easier, I export scope measurements as CSV files, which are then post-processed (mostly in Microsoft Excel, which is not the best tool for the job, but it is all I have at my ...
3
votes
1answer
372 views

Determination of periodicity in data and finding mean

I have to find whether there is any pattern (I mean periodicity or close to periodicity) and if there is, for one cycle i have to perform numerical integration to determine mean. In the first picture ...
2
votes
3answers
2k views

Averaging filters

If a signal undergoes repeated averaging (n times) with a filter (h) of size m. Is it possible to achieve the same averaging result with an averaging filter(H) of a larger size? h = {1/m, 1/m... m ...
2
votes
1answer
85 views

A general conceptual understanding of moving average

I have a conceptual question here. I understood how to calculate a Moving Average(MA). For example : x(n) = 0, 1, 2, 3, 4, 5 MA = 0, 1/2, 3/2, 5/2,7/2, 9/2, where for calculation of the MA we only ...
2
votes
1answer
126 views

Terminologies - lags, order in time series model

I am facing some difficulties with the terminologies - lag ($p$) and sequence length (number of data points) (N) used in time series model such as Moving average and Autoregressive model. Considering ...
2
votes
1answer
71 views

Envelop detection with low sample rate?

I have a signal up to $3\textrm{ MHz}$. The ADC that sample it has a rate of $1.5\mu s$. So a full $T$ of the signal is $0.3\mu s$, and I can only sample each $1.5\mu s$. It sounds not enough, but I ...
2
votes
2answers
4k views

Is this code for doing a moving average correct?

Is this code for doing a moving average correct? y=conv(x, ones(1,100)/100); I want to filter my speech signal with moving average filter in code. I think that ...
2
votes
1answer
561 views

Gain function calculation (frequency response)

Define moving average process $y_t := 0.5 x_t + 0.5 x_{t-1}$ where $x_t := e^{i2 \pi t}$. Its frequency response is then: $$H(f) = 0.5 + 0.5 e^{-i2\pi f}$$ Recall that the frequency response in ...
2
votes
2answers
341 views

Mean delay for a M tap harmonically weighted filter

I am trying to derive the mean delay for $M$ filter taps harmonically weighted: $$y[n] = \frac{M\,x[n] + (M-1)x[n−1]... + 1 \cdot x[n−M+1]}{\tfrac12 M (M + 1)}$$. For a uniformly weighted filter, I ...
2
votes
1answer
189 views

Conceptual Question from Signal Processing - Impulse Response and AR Coefficients

In continuation to the previous question Conceptual questions from signal processing I have a doubt which is: Consider an Autoregressive model (AR(2)): $$ y(t) = ay(t-1) + by(t-2) $$ and a FIR (...
2
votes
2answers
4k views

Weight vector of an exponential moving average?

With weight vector I mean the vector with weights that you have to multiply the observations in the window that slides over your data with so if you add those products together it returns the value of ...
2
votes
1answer
146 views

Generalized/Power means in DSP

Generalized/power means may be used to construct moving-average filters with different properties than regular one which is based on arithmetic mean. This observation seems to be trivial - even ...
2
votes
1answer
321 views

Taking the Moving Average of STFT Results

I realize that this seems redundant, but I'm getting consistently better results when performing machine learning techniques that use spectral features extracted using the moving average process below,...
2
votes
1answer
147 views

How to remove historical values from exponential filter

Suppose I have two time series $A:=[0,0,0,4,5,6]$ and $B:=[1,2,3,4,5,6]$. I implement the following filter (with initial value at the first element): $$ f(t) = f(t-1) + \alpha*(f(t)-f(t-1))$$ with $\...
2
votes
1answer
713 views

Is step detection the correct approach to this problem? what if not?

I'm looking for some advice on where and what to start reading for learning to solve this. I've the time series of the position coordinates (x,y) of an animal in an open field (just a cage). I want ...
2
votes
0answers
223 views

Deconvolution of non-stationary, 1-D signal?

I have a time series that has been measured after convolution with a moving average filter. Knowing the parameters of the moving average filter, is it possible to reconstruct/constrain the values of ...
1
vote
1answer
54 views

Is it correct to call a Savitsky-Golay filter of degree 0 a simple moving average?

I had this question after seeing that polynomial regressions fit polynomial functions of different degrees to a time-series, since the mean of a time series is a constant and that a constant is also a ...
1
vote
2answers
719 views

Moving Average for Notch filtering

I have a periodic signal(ECG) with period of ~1 seconds. It does not have features that are shorter than 0.04 seconds. For removal of 60Hz, I thought instead of implementing a notch filter, doing a ...
1
vote
2answers
1k views

Moving Average of sinusoid

If you calculate a simple moving average over a window length that is equal to the period of the sinusoid, you get a straight line (=0 because the wave is symmetric around the X-axis): the wave has a ...
1
vote
2answers
113 views

MATLAB: Implementing Least Squares Estimator for a Given Model

The formula to estimate $\mathbf{h}$ is then $$\hat{\mathbf{h}} = (X^T X)^{-1} X^T \vec{y}\tag{2}$$ I think this can be implemented in Matlab using ...
1
vote
2answers
1k views

When should we using moving average in algorithm design?

I'm new to signal processing. And I just read G.720.1. I find there is a lot of moving average used. And I can also recall there is a lot of moving average been used in other audio processing ...
1
vote
1answer
218 views

Is there a clever way to implement cascaded moving average filters?

I'd like to effeciently approximate a gaussian filter's step response using cascaded moving average filters. I know about recursive moving average, but is there some clever algorithm to cascade them ...
1
vote
1answer
309 views

MAD and RMS SNR relation

Recently I've found a formula relating mean average deviation (MAD) SNR to root mean square (RMS) SNR: $$\text{SNR}_\text{MAD} = \sqrt{\frac{2}{\pi}} \text{SNR}_\text{RMS} $$ which assumes Gaussian ...
1
vote
2answers
97 views

How is that after random numbers with their negatives alternating passing through 5, 4, 3 order moving average filter, become quasi sinusoidals?

I have passed random numbers $${89, 58, 13, 70, 24}$$ with their negatives alternating, through 5 order moving average filter and output was positive and negative numbers alternating. After I have ...
1
vote
1answer
42 views

Denoising approach for a combination of several ADC voltage channles

I have 2 ADC channels of constant voltage measurement with small amount of high frequency noise only and no low frequency oscillations. The final signal should be the simple sum of those and denoised ...
1
vote
1answer
284 views

How to filter uniform noise in a microcontroller?

By uniform noise I mean a band of a fixed width, no spikes, etc. This has to be one of the simplest examples. I'm looking for the appropriate theoretical approach as much as something relatively ...
1
vote
2answers
56 views

How to discard deviating values from standard deviation and running average

I'm building a inductive vehicle loop detector. By measuring the frequency of a LC-oscillator where the cars will pass over the inductor of the LC-Oscillator. If the cars pass over the inductor the ...
1
vote
1answer
267 views

Moving average filter for sound in MATLAB [closed]

y[n] = b0x[n] +b1x[n-1] I have this MA filter in matlab as following ...
1
vote
1answer
100 views

Moving average algorithm that conserves integral

Suppose I have point array $y_i$ of size $N$. How to implement moving average algorithm that conserves quantity $$ I = \sum_{i=1}^{N}y_i $$ NOTE: I don't want time shift so I would prefer to use ...
1
vote
1answer
135 views

Why dft of moving average impulse response has 0 angle

I wanted to visualise angle and magnitude of moving average DFT. I used python3 for that: ...
1
vote
1answer
70 views

Help in problem formulation for estimation of image as a feature vector - SISO or MIMO FIR channel model?

Based on the paper Blind Image deconvolution: A feature vector is a list of numbers used to represent an image. The feature vector for my case takes values as symbols $-1,1$. An instance or an ...
1
vote
1answer
145 views

What are the ripple and attenuation in a set of moving average filters?

Ladies, Gentlemen, Consider following set of moving average filters: (1) - 100 coefficients equal to 1/100 (2) --- 95 coefficients equal to 1/95 (3) --- 90 coefficients equal to 1/90 (4) --- 85 ...
1
vote
0answers
49 views

Moving average and linearization of two piecewise linear systems

I have 2 oversampling ADC's running parallelly, each to process data in a specific range of the input as shown below: Each ADC can process only half cycle range of a sine wave. Each ADC adds its own ...
1
vote
3answers
519 views

Denoising a signal

I'm starting hydraulic experiments, where I'd have to measure velocity in an unsteady flow with a device called Acoustic Doppler Velocimeter. In DSP terms, I'd have a nonstationary signal in a shape ...