필터 지우기
필터 지우기

Filtering white noise with first and second order filter

조회 수: 3 (최근 30일)
arash rad
arash rad 2021년 2월 9일
댓글: Mathieu NOE 2021년 2월 10일
Hi everyone
I have a question about filtering white noise with a discrete tf like below :
but i dont know use data or frequency for axis x ?
I use data and I have something like this
my x axis is data and my y axis is amplitude
do you think is it correct or i should do it with frequency?
if i am wrong what should i do ?
Thanks
my code is
clc
clear all
close all
dt = 0 ;
T = 100;
ts = 0.1;
t = dt:ts:T-ts;
N = numel(t) ; %number of data
u = randn(N,1);
H1 = tf((sqrt(3)/2),[1 0.8],ts) %first order filter
y= zeros(N,1);
a = 0.8;
b = sqrt((3)/2);
for i =2:T-ts
y(i) = a*y(i-1) + b*u(i-1);
end
plot(u)
hold on
plot(y)
title('Filtering White Noise')
ylabel("Amplitude")
xlabel("Data")
legend("white noise","filtered white noise")
  댓글 수: 1
Mathieu NOE
Mathieu NOE 2021년 2월 10일
hi
look at filter and filtfilt functions
I prefered to do the demo on a unity gain (dc gain = 1) filter so it appears evident that the filtered signal is lower in amplitude
clc
clear all
close all
dt = 0 ;
T = 100;
ts = 0.1;
t = dt:ts:T-ts;
N = numel(t) ; %number of data
u = randn(N,1);
% discrete filter num and denominator
% num = [sqrt(3)/2 0];
a = 0.8;
num = [1-a 0]; % unity gain LP filter
den = [1 -a];
y = filter(num,den,u);
plot(t,u,'b',t,y,'r')
title('Filtering White Noise')
ylabel("Amplitude")
xlabel("Data")
legend("white noise","filtered white noise")

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by