matlab常用函数之滤波器

水深无声 2023-07-22 09:26 153阅读 0赞

1、filter

  1. clear;clc;close all;
  2. t = linspace(-pi,pi,100);
  3. rng default %initialize random number generator
  4. x = sin(t) + 0.25*rand(size(t));
  5. windowSize = 5;
  6. b = (1/windowSize)*ones(1,windowSize);
  7. a = 1;
  8. y = filter(b,a,x);
  9. plot(t,x)
  10. hold on
  11. plot(t,y)
  12. legend('Input Data','Filtered Data')

图形显示:

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d1d3VrdTEyMw_size_16_color_FFFFFF_t_70

filter

发表评论

表情:
评论列表 (有 0 条评论,153人围观)

还没有评论,来说两句吧...

相关阅读