sliding window for a sampled signal

4 次查看(过去 30 天)
I sampled a continuous signal by using rate transition block in Simulink. now, How can I calculate the maximum absolute value of previous i.e. 100 samples for each input sample. is there any simulink block? or should I use any digital filter and how?

回答(2 个)

Rik
Rik 2017-7-5
When you have the signal as a vector, you can use movmean to find the moving average. You can modify the window to only include the previous 99 values to get a 100 value wide window.
M = movmean(A,[99 0]);
  2 个评论
Mohammad Wasi Ahmadi
My signal is a time domain, not a vector. and I need the maximum value of previous 100 samples. I used the movmean and moving maximum blocks in simulink but they did not work and gives dimension error
Mohammad Wasi Ahmadi
I used movmax but the output is mxArray. how can I change to a double variable?

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2017-7-9
Perhaps you could use a Buffer Block with overlap specified.

类别

Help CenterFile Exchange 中查找有关 Array and Matrix Mathematics 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by