Czy ktoś mógłby mi powiedzieć z jakiego programu to jest kod i podpowiedzieć jak przerobić go na kod R lub matlab. Szczególnie zastanawia mi funkcja LSfilter
- dt =0.01; N =1000; t =[1: N ]* dt ; SNR =2.0; m =1; l =1; a = -0.2; b =1; c =1; % sys tem parame ters
- RMSn = 1/ sqrt ( dt ); % RMS o f u n i t w h i t e n o i s e
- RMSy = sqrt ( -0.5* b ˆ2* c ˆ2/ a ); % RMS o f sys tem re s p o n se
- d = RMSy /( SNR * RMSn ); % s c a l e measurement n o i s e
- y = lsim (a ,b ,c ,0 , randn(m , N )/ sqrt ( dt ),t ,0); % s im ul a t e sys tem
- y_meas = y + d * randn(l , N )/ sqrt ( dt ); % n o i s y measurement
- H = LSfilter ( y_meas , y , ’ fit ’, K ); % f i t Wiener f i l t e r
- y_hat = LSfilter ( y_meas , zeros (l , N), ’ predict ’, H ); % run Wiener f i l t e r
- FitError = norm( y - y_hat , ’ fro ’ ) / norm( y , ’ fro ’); % e v a l u a t e f i t e r r o r
- y = lsim (a ,b ,c ,0 , randn(m , N )/ sqrt ( dt ),t ,0); % s im ul a t e v a l i d a t i o n da t a
- y_meas = y + d * randn(l , N )/ sqrt ( dt ); % n o i s y measurement
- y_hat = LSfilter ( y_meas , zeros (l , N), ’ predict ’, H ); % p r e d i c t cl e a n s i g n a l
- PredictionError = norm( y - y_hat , ’ fro ’ ) / norm( y , ’ fro ’); % e v a l u a t e p r e d i c t i o n e r r o r