How to apply a low-pass or high-pass filter to an array in Matlab?

后端 未结 2 1920
[愿得一人]
[愿得一人] 2020-12-01 10:57

Is there an easy way to apply a low-pass or high-pass filter to an array in MATLAB? I\'m a bit overwhelmed by MATLAB\'s power (or the complexity of mathematics?) and need an

2条回答
  •  粉色の甜心
    2020-12-01 11:21

    You can design a lowpass Butterworth filter in runtime, using butter() function, and then apply that to the signal.

    fc = 300; % Cut off frequency
    fs = 1000; % Sampling rate
    
    [b,a] = butter(6,fc/(fs/2)); % Butterworth filter of order 6
    x = filter(b,a,signal); % Will be the filtered signal
    

    Highpass and bandpass filters are also possible with this method. See https://www.mathworks.com/help/signal/ref/butter.html

提交回复
热议问题