dear
I want to apply loop in a way that there is a window of 2000 samples and will increment by 500 samples...
means window size (w) increase like: 0-2000, 2500-4500, 5000-7000, 7500-9500....till 30000.
then the window (w) apply in same way on data (x) like = 0-2000, 2500-4000 etc...
how can i do this?
x = dath001 % data, size 30000x4
w = hann(2000); % window
datawindow = w.*x(1:2000,:); % apply window in data

 Respuesta aceptada

Star Strider
Star Strider el 7 de Ag. de 2019

0 votos

You have the Signal Processing Toolbox, so see if the buffer function will do what you want.

5 comentarios

Ali Asghar
Ali Asghar el 8 de Ag. de 2019
ill look into buffer function.
Ali Asghar
Ali Asghar el 10 de Ag. de 2019
dear
clear all,close all, clc
load ('dath001.mat');
x = dath001; % 30000x4 size
w = hann(2000);
datawindow1 = w.*buffer(x(:,1),2000,-500);
datawindow2 = w.*buffer(x(:,2),2000,-500);
datawindow3 = w.*buffer(x(:,3),2000,-500);
datawindow4 = w.*buffer(x(:,4),2000,-500);
above program give
datwindow1 = 2000x12
datwindow2 = 2000x12
.
.
datwindow4 = 2000x12
I want one variable
datawindow give 24000x4 values.
also tell how i apply loop for datawindow1-4...
Thank you
Star Strider
Star Strider el 10 de Ag. de 2019
You do not need a loop. Just create column vectors from the individual ‘datawindow’ results, and concatenate them horizontally.
This will probably work:
datawindow = [datawindow1(:), datawindow2(:), datawindow3(:), datawindow4(:)];
I do not have your data, so I cannot test it with them.
Ali Asghar
Ali Asghar el 11 de Ag. de 2019
Thanks alot dear....
Star Strider
Star Strider el 11 de Ag. de 2019
As always, my pleasure.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 7 de Ag. de 2019

Comentada:

el 11 de Ag. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by