simple examples of filter function, recursive option specifically

前端 未结 4 1756
走了就别回头了
走了就别回头了 2020-12-02 15:36

I am seeking some simple (i.e. - no maths notation, long-form reproducible code) examples for the filter function in R I think I have my head around the convolu

4条回答
  •  猫巷女王i
    2020-12-02 16:26

    I spent one hour in reading this, below is my summary, by comparison with Matlab

    NOTATION: command in Matlab = command in R

    filter([1,1,1], 1, data) = filter(data, [1,1,1], method = "convolution") ; but the difference is that the first 2 elements are NA 
    
    
    filter(1, [1,-1,-1,-1], data) = filter(data, [1,1,1], method = "recursive")
    

    If you know some from DSP, then recursive is for IIR, convolution is for FIR

提交回复
热议问题