I am trying to use a filter to smooth time-series data. Although it's been a good 5 years since my last signal and systems / control systems course, I have recently started experimenting with the butter and cheby2 filter design functions in Octave. I have a filter that smooths the input data well (low-order / low cutoff frequency), but sometimes when the input changes abruptly, the output cannot keep up (I know I could raise the order of the filter / raise cutoff frequency to improve response, but that sacrifices smoothness). How do I apply feedback to my filter such that the output follows the input closer when there are large changes in input? I basically want to take my filter and add on a factor equal to the difference between the input and output. I remember that there was a function called feedback for the continuous time case, but don't recall how to apply feedback to a discrete time filter.
Newbie Matlab Digital Filter / Feedback Question
Started by ●January 13, 2011
Reply by ●January 13, 20112011-01-13
Design a set of feedforward filters. Delay balance them. Then have a mux at the output to switch from one to another. While switching just make sure that you go in small steps from one to another. This way you will not need any feedback mechanisms. Regards Bharat
Reply by ●January 13, 20112011-01-13
On Thu, 13 Jan 2011 07:44:24 -0600, j26 wrote:> I am trying to use a filter to smooth time-series data. Although it's > been a good 5 years since my last signal and systems / control systems > course, I have recently started experimenting with the butter and cheby2 > filter design functions in Octave. I have a filter that smooths the > input data well (low-order / low cutoff frequency), but sometimes when > the input changes abruptly, the output cannot keep up (I know I could > raise the order of the filter / raise cutoff frequency to improve > response, but that sacrifices smoothness). How do I apply feedback to > my filter such that the output follows the input closer when there are > large changes in input? I basically want to take my filter and add on a > factor equal to the difference between the input and output. I remember > that there was a function called feedback for the continuous time case, > but don't recall how to apply feedback to a discrete time filter.As long as you have a linear filter, using feedback is going to leave you with the same tradeoff between smoothness and transient response that you have now. It sounds like you're using IIR filters -- have you considered using FIR filters? A good FIR filter will still have delay, but you may like the shape of the transient response better. If that doesn't make you happy, then you'd need some sort of a nonlinear filter, one that looks for a large difference between input and output (or for large jumps in the input) and changes the filter gains until the output has caught up. -- http://www.wescottdesign.com
Reply by ●January 13, 20112011-01-13
>On Thu, 13 Jan 2011 07:44:24 -0600, j26 wrote: > >> I am trying to use a filter to smooth time-series data. Although it's >> been a good 5 years since my last signal and systems / control systems >> course, I have recently started experimenting with the butter andcheby2>> filter design functions in Octave. I have a filter that smooths the >> input data well (low-order / low cutoff frequency), but sometimes when >> the input changes abruptly, the output cannot keep up (I know I could >> raise the order of the filter / raise cutoff frequency to improve >> response, but that sacrifices smoothness). How do I apply feedback to >> my filter such that the output follows the input closer when there are >> large changes in input? I basically want to take my filter and add ona>> factor equal to the difference between the input and output. Iremember>> that there was a function called feedback for the continuous time case, >> but don't recall how to apply feedback to a discrete time filter. > >As long as you have a linear filter, using feedback is going to leave you>with the same tradeoff between smoothness and transient response that you>have now. > >It sounds like you're using IIR filters -- have you considered using FIR >filters? A good FIR filter will still have delay, but you may like the >shape of the transient response better. > >If that doesn't make you happy, then you'd need some sort of a nonlinear >filter, one that looks for a large difference between input and output >(or for large jumps in the input) and changes the filter gains until the >output has caught up. > >-- >http://www.wescottdesign.com >I'll try the FIR filter, there's design functions for that in Octave. But how would I go about designing a non-linear filter? Are there any guides, functions, or resources that you can recommend? I appreciate all the responses.
Reply by ●January 13, 20112011-01-13
>On Thu, 13 Jan 2011 07:44:24 -0600, j26 wrote: > >> I am trying to use a filter to smooth time-series data. Although it's >> been a good 5 years since my last signal and systems / control systems >> course, I have recently started experimenting with the butter andcheby2>> filter design functions in Octave. I have a filter that smooths the >> input data well (low-order / low cutoff frequency), but sometimes when >> the input changes abruptly, the output cannot keep up (I know I could >> raise the order of the filter / raise cutoff frequency to improve >> response, but that sacrifices smoothness). How do I apply feedback to >> my filter such that the output follows the input closer when there are >> large changes in input? I basically want to take my filter and add ona>> factor equal to the difference between the input and output. Iremember>> that there was a function called feedback for the continuous time case, >> but don't recall how to apply feedback to a discrete time filter. > >As long as you have a linear filter, using feedback is going to leave you>with the same tradeoff between smoothness and transient response that you>have now. > >It sounds like you're using IIR filters -- have you considered using FIR >filters? A good FIR filter will still have delay, but you may like the >shape of the transient response better. > >If that doesn't make you happy, then you'd need some sort of a nonlinear >filter, one that looks for a large difference between input and output >(or for large jumps in the input) and changes the filter gains until the >output has caught up. > >-- >http://www.wescottdesign.com >I'll try the FIR filter, there's design functions for that in Octave. But how would I go about designing a non-linear filter? Are there any guides, functions, or resources that you can recommend? I appreciate all the responses.
Reply by ●January 13, 20112011-01-13
Reply by ●January 13, 20112011-01-13
j26 wrote:> By the way, would the non-linear filter have variable gain or would it have > variable bandwidth?
Reply by ●January 13, 20112011-01-13
Reply by ●January 13, 20112011-01-13
Reply by ●January 13, 20112011-01-13
> > >j26 wrote: > >> By the way, would the non-linear filter have variable gain or would ithave>> variable bandwidth? >Sorry for the multiple posts...I don't like the DSP Related forum interface and the duplicates were unintentional and caused by hitting the refresh button to get back to this thread...mods, please delete the extra posts. But Vladdy, why do you feel that my post was a stupid question? I mentioned in the subject line that I'm a DSP newbie and I'm just here to learn. I don't understand why you have to be so offensive.