Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Sponsor

Industry's highest performing at the lowest power DSPs now as low as $5.00*
Start development today!
*volume pricing for 10ku

Discussion Groups

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Matlab DSP | Running Average

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

Running Average - Author Unknown - Nov 14 21:42:00 2001

I am new to using Matlab and Simulink. I am trying to model a systems
that contains a running average. Does anyone know a way to model this?
The requirement is something like

output = a running average of latest 0.75 seconds of the input.

Any help is appreciated

Thank you




______________________________
Start your Android Ice Cream Sandwich development on TI's AM35x Sitara ARM Cortex-A8 processor today.



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: Running Average - Michael Strothjohann - Nov 15 8:28:00 2001

hi ???,

it sounds like a homework?
if you don't need some form of real time
any form of conv will do. if you are
interested in optimising this, you
may use the very,very famous :
"next outgoing sample" = "last outgoing sample"
+ "newest incoming sample" - "incoming sample 0.75 sec past"
you need a memory for the outgoing sample
and a cycl. buffer for the last incoming samples.
have a nice time.
BTW.: designing any signal processing algorithm
( running avarage is one of the simplest one )
you have to think twice about the border
(i.e. what to do at the begining and the ending
of our incoming samples)
again: have a nice time.

michael schrieb:
>
> I am new to using Matlab and Simulink. I am trying to model a systems
> that contains a running average. Does anyone know a way to model this?
> The requirement is something like
>
> output = a running average of latest 0.75 seconds of the input.
>
> Any help is appreciated
>
> Thank you > _____________________________________
> /groups.php3



______________________________
Start your Android Ice Cream Sandwich development on TI's AM35x Sitara ARM Cortex-A8 processor today.



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

RE: Running Average - Michal Kaczmarek - Nov 15 8:38:00 2001

Hi,
Try this:

function[out] = runavg(in,N)
%N - window length
%in - input vector
%out - output vector

for(i=1:length(in)-N)
out(i)=sum(in(i:i+N)/N);
end

Michal


______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )