how to smooth an imported signal in workspace?

조회 수: 1 (최근 30일)
iyad salameh
iyad salameh 2015년 1월 31일
편집: iyad salameh 2015년 1월 31일
i have data of sensor readings that i imported to matlab's workspace as a matrix , and the signal is very noisy so i want to filter it with low pass filter , and save it as a new matrix in workspace, how do i do that ? help please . the data is recorded at 10Hz. i applied the following code but it gave me the exact results of the unfiltered signal. (the results picture is attached)
t = (1:436);
plot( t, baroz2_crop), axis tight;
ylabel('Height (m)');
xlabel('time');
title('Quadrotor height');
%
noise = 10;
coeff1 = ones(10, noise)/noise;
%
avg1baroz2_crop = filter(coeff1, 10, baroz2_crop);
plot(t, [baroz2_crop avg1baroz2_crop]);
legend('noise','10 seconds average (delayed)','location','best');
ylabel('height');
xlabel('time');
title('Quadrotor height');
%
figure
delta_baroz_crop = baroz2_crop - avg1baroz2_crop;
delta_baroz_crop = reshape(delta_baroz_crop, 10, 436).';
%
plot(1:436, mean(delta_baroz_crop)), axis tight;
title('Mean Quadrotor height ');
xlabel('time');
ylabel('height');

답변 (0개)

카테고리

Help CenterFile Exchange에서 Smoothing and Denoising에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by