Skip to main content

Questions tagged [moving-average]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
3 answers
1k views

Fixed-point Exponential Moving Average filter with given cutoff frequency

I want to implement in fixed point arithmetic an exponential moving average filter, with a specific cutoff frequency for a given sampling rate. The formula for the filter is $$ y_n = \alpha x_n + (1 -...
5 votes
3 answers
572 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 ...
0 votes
0 answers
11 views

Difference transformation and Stationarization of Moving Average

I have a temperature sensor data, I want to denoise it. The first thing that came to my mind was to take the moving average, it was very smooth but it is still not stationary. If I take the log ...
0 votes
1 answer
59 views

Lowpass Filter to Average sinusoid signal

How to get an average of a sinusoidal signal? The frequency of a signal is 50 Hz and could have harmonics, i.e. high THD. I tried to use exponential moving average with low cut-off frequency (about 1....
1 vote
0 answers
28 views

How to implement scale-dependent Gaussian averaging using Morlet wavelet envelope in Python?

I'm trying to reproduce the scale-dependent Gaussian averaging of a time series as described in this paper: https://arxiv.org/pdf/1706.01126.pdf The process involves performing a continuous wavelet ...
7 votes
3 answers
198 views

Why use an ARMA process theory instead of just performing linear regression?

I am studying ARMA processes. At the end of the course the professor told us that estimating the next sample in an arma process using past of length $p$ (so performing a projection of $X_t$ on $\text{...
2 votes
1 answer
260 views

How to apply least-squares estimation for sparse coefficient estimation?

The model is expressed as follows $$y(n) = \sum_{i=0}^{p-1} r(i) x(n-i) + v(n) \tag{1}$$ where $\mathbf{r} = \begin{bmatrix} r_1 & r_2 & \ldots &r_p \end{bmatrix}^T$ is the sparse length-$...
0 votes
1 answer
53 views

Derive PSD of an MA(1) process

Suppose there is a moving average process of order 1 that also includes a zeroth term thus: \begin{equation} Y_t=\theta\left(B\right)X_t = \left(\theta_0+\theta_1B\right)X_t \end{equation} where $X_t$ ...
0 votes
1 answer
72 views

Moving average of a signal

Problem is to find 1 second moving average of a signal having sample time as Ts. To solve this, it is suggested to pass the signal through a Butterworth low pass filter having the following ...
1 vote
2 answers
32 views

What is the difference of calculating signal power that using these two methods: using moving average filter and using forgetting factor?

The conventional signal power calculation can be: $$ P(n) = \frac{1}{N}\sum_{i=0}^{N-1}x^2(n-i) $$ $x(n)$ is the signal. However, I have seen another method: $$ P(n) = \lambda P(n-1) + (1-\lambda) x^2(...
1 vote
0 answers
129 views

average after Kalman filter and how to deal with drift

This is in the context of mobile device localization. The mobile device does not move. All I have is the delay estimated from the signal sent by the mobile device ('measure' in blue). With a simple ...
4 votes
1 answer
346 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 ...
1 vote
2 answers
655 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
2 answers
2k views

Rolling average in pandas using a Gaussian window

I want to estimate the rolling average of a time series B using a Gaussian window. The equation to do this would correspond to $$\tilde{B_{s}}(t_{n}) = \frac{1}{A_{s}} \sum_{t_{m}= t_{n}-3s}^{t_{n}+3s}...
1 vote
0 answers
73 views

2D moving average model for image synthesis - how to interpret this algorithm?

Background: I'm working on a 2D Moving-Average (MA) estimator for image processing stuff and I'm trying to follow along from a paper that defines the algorithm for estimation. The main equation for ...
6 votes
3 answers
2k views

Moving average before downsampling: effect on Nyquist frequency?

First the simple questions: Is there an effect on the Nyquist frequency when I apply a moving average filter on the raw data before I downsample? And what does this do to aliased frequencies? ...
3 votes
1 answer
636 views

Allan deviation to determine averaging time

Thanks in advance for the help. I don't post on here often, so I hope I can convey my question properly. I think I understand what the Allan deviation (same as IEEE Allan variance?) does. You take a ...
1 vote
1 answer
171 views

Frequency components in Bin averaging

I am back with another question. Context for the question: I am trying to smooth out the angular velocity data from an encoder. The encoder has 720 ppr and the rough angular speed of the wheel is ...
2 votes
1 answer
11k views

Is there a Python method to calculate moving RMS of a signal? How to calculate the moving RMS using the discrete signal formula? [closed]

I'm trying to calculate a moving RMS of an acceleration signal. One of the answers in the post, shows the formula for calculating moving RMS for discrete signal. The formula they suggest: I have a ...
0 votes
1 answer
54 views

Find the impulse response of a causal 52 day moving average system to be used in stock market [closed]

Moving average system………………………. How to solve this one?
4 votes
2 answers
437 views

The Logic Behind Cascading a Moving Average Filter After a Median Filter

Why do we cascade a median filter and a moving average filter? I know how each filter performs, but I do not know the difference between these two filters in denoising application and what is the ...
8 votes
7 answers
81k 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-...
2 votes
2 answers
644 views

Why couldn't I reapply a LPF to remove more noise?

I have a piece of raw accelerometer data consisted of 10,000 samples to be processed offline. Since the movement or rotation of the object is moderately slow and smooth, I would think that I can ...
1 vote
1 answer
264 views

Rolling sum of dataframe with custom function gets really slow on large averaging windows. Can I fix with convolve?

I am using the following function to estimate the Gaussian window rolling average of my timeseries. Though it works great from small size averaging windows, it crushes (or gets extremely slow) for ...
1 vote
0 answers
99 views

How to optimize noise reduction to perform burst detection and detect oscillations?

Let be $\mu_k$ some univariate signals of time $t$. I am performing burst detection to detect oscillations in any signal $\mu_k$. I tested the following methods : Perform noise reduction on $\mu_k$ ...
0 votes
1 answer
323 views

Average of discrete periodic signal

I am working on a project which, at some point, relies on the computation of the average of discrete signals, which typically look like this: The project generates hundreds of such signals, and: the ...
-1 votes
1 answer
52 views

Difference between the average operation and the application of the equivalent LPF

I would be glad if someone could answer my question. I have a bit stream of data and I want to extract the low frequency component. When post processing the data I can calculate the average value over ...
-1 votes
1 answer
994 views

Faster way to Implement a CFAR (window average) Threshold

I implemented a version of a CFAR average in MATLAB but it's 'slow' and I need to speed it up. I included the pseudo code and logic below. I used a nested for loop to calculate the moving average but ...
2 votes
1 answer
622 views

autoregressive moving average code implementation

I am new to DSP and i am trying to take a wav (human speech) file and apply ARMA filter and plot its PSD graph in python. I see that there are a lot of AR implementations but almost none ARMA. I ...
2 votes
1 answer
200 views

What happens when filter ringing is far longer than the signal itself?

I'm digging into some (quite popular in my field) analytical practice that I find suspicious. The problem is to remove the trend from some very short (eg. 18-40 data points representing 200 - 800 ms) ...
0 votes
2 answers
193 views

Boxcar, Removing DC signal from an ADC on a FPGA

I have been reading on different ways to do this. I have seen this Linear-phase DC Removal Filter This seems like it would work just fine, but it would take some time to implement. Is there any reason ...
3 votes
1 answer
120 views

How to interpret power of a two-point average signal

Consider a DT signal $x[n]$. Define the two-point moving average signal : $$ y[n]:=\frac{1}{2}x[n]+\frac{1}{2}x[n-1] $$ Define : $$ \langle x[n]\rangle:=\lim_{N\to\infty}\frac{1}{2N+1}\sum_{n=-N}^{N}x[...
1 vote
4 answers
5k views

Group delay of moving average filter

I have implemented a moving average filter (in Python) where I fill a list with values and average them. When new values arrive the oldest will be deleted. Now I am wondering how much delay I get ...
1 vote
2 answers
121 views

System identification for a single-input-single-output-system

Let $u(n)$ be the input and $v(n)$ the output of a single-input-single-output system described by the Auto-Regressive-Moving-Average equation $$v(n)=\sum_{k=0}^{m_{0}}b_ku(n-k)+\sum_{k=1}^{n_{0}}a_{k}...
3 votes
4 answers
664 views

Filtering Angular Measurements

I am trying to apply a filter to reduce noise in angular measurements. Since the data comes with noise, the filter needs to be able to handle measurements that are not smoothly progressing; for ...
1 vote
1 answer
1k views

Moving average filter implementation in the floating point [closed]

I have following C++ implementation of the moving average digital filter. ...
0 votes
1 answer
3k views

Impulse Response of a Moving Average System

According to Discrete Time Signal Processing by Al Oppenheim 3rd Edition, the impulse response of a moving average filter is as below My question is that shouldn't h[n] be having the dirac delta ...
4 votes
1 answer
749 views

moving average rounding error analysis

I have implemented a moving average, similar to the Hogenauer Filter, with a reduced number of computation operations. I expect the expected error to behave as the random walk and its STD to be of ...
1 vote
2 answers
146 views

Analysis of the ratio of two moving average filters

I have created a basic segmentation algorithm for 1-D signals (e.g. audio) based on a ratio of energy averages. The classification rule involves comparing the signal energy measured over a short time ...
1 vote
1 answer
124 views

Moving average frequency response over an image

I'm studying image denoising by linear filtering with cross-correlation, in particular with a moving-average kernel (K x K kernel of all equal elements which sum is 1). For clarity, I'd like to refer ...
1 vote
0 answers
37 views

How to select the ARMA model parameters?

I have a series of data containing 120,000 points. The mean of each N(=60) point is zero. I want to forecast the next 60 points using the ARMA model. My question is, specificaly, how to choose the ...
0 votes
2 answers
443 views

Calculating filter coefficients of a Moving average with error correction

I have an oversampling ADC where I need to correct Gain/offset errors 'during' each conversion. This also links to my previous question - Moving average and linearization of two piecewise linear ...
0 votes
0 answers
463 views

Moving average filter output magnitude in simulink

I was using the Moving average filter provided by simulink. I set the window length equal to 31 samples and i was using a fixed step solver with a step size of $\frac{1}{(50\times24)}$. I used a unit ...
0 votes
1 answer
79 views

How to solve this Laplace integral for an averaging function in an iterative numerical (finite difference) model?

I am trying to implement a mathematical model for vibrational damping described in this article. They provide an equation for damping force ($F$) as a function of: a spring constant ($k$) a damping ...
0 votes
1 answer
228 views

Is it possible to specify number of taps and cutoff frequency independently?

When specifying the properties of a moving average filter, is it possible to specify the number of taps and the cutoff frequency? My guess is no since taps (the number of samples in a moving average ...
11 votes
5 answers
11k 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 ...
1 vote
0 answers
95 views

Spatial moving average in array antenna processing

In array processing the theoretical spatial response of the array is calculated by doing DFT on sensor locations for some assumed wave number (1/wavelength). The figures below shows the sensor ...
7 votes
5 answers
7k views

3dB-Cut off frequency of moving average

I've read the thread: Cut off frequency of moving average And I use the second answer in my algorithm to calculate the 3dB cut off frequency of my filter, which works great, as my filter length is ...
34 votes
2 answers
63k 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 ...
2 votes
1 answer
601 views

How to filter a signal using a bandpass filter consisted of two moving average filters?

I want to filter a PPG signal on a microcontroller. I have limited memory and a was searching for low computational methods. I found the work of Kazuhiro Taniguchi, Earable POCER: Development of a ...