Hello all, Here is my problem: My Sample Rate is 50kHz, there is a 1st order analog LPF (simple Resistor Capacitor) and it's cutoff is 33kHz. This filter is on the output of my DACs and then the signal is routed back into the DSP via an ADC running at the sample rate Now, I would like to model this same filter in the DSP but I CANNOT! The simple reason is that the cutoff of this analog filter is out-of-band from my digital domain. (i.e. 33kHz cutoff is greater than Nyquist of 25kHz). Some of you may be saying: "who cares? It is beyond your digital bandwidth, so just ignore it." But the problem is that a 1st order filter has A LOT of rolloff. I see as much as -2dB at my Nyquist frequency of 25KHz. I am trying to model this attenuation inside the DSP AND the phase response as well. If it weren't for the phase part I would just fit a parametric EQ filter or shelving filter. Also, I am trying to stay with a small IIR design if at all possible. Thanks, Jeff
Creating the digital equivalent of an out-of-band analog filter
Started by ●October 19, 2010
Reply by ●October 19, 20102010-10-19
sparafucile17 wrote:> Here is my problem: > > My Sample Rate is 50kHz, there is a 1st order analog LPF (simple Resistor > Capacitor) and it's cutoff is 33kHz. This filter is on the output of my > DACs and then the signal is routed back into the DSP via an ADC running at > the sample rate > > Now, I would like to model this same filter in the DSP but I CANNOT! The > simple reason is that the cutoff of this analog filter is out-of-band from > my digital domain. (i.e. 33kHz cutoff is greater than Nyquist of 25kHz). > > > Some of you may be saying: "who cares? It is beyond your digital > bandwidth, so just ignore it." But the problem is that a 1st order filter > has A LOT of rolloff. I see as much as -2dB at my Nyquist frequency of > 25KHz. I am trying to model this attenuation inside the DSP AND the phase > response as well. > > If it weren't for the phase part I would just fit a parametric EQ filter or > shelving filter. > > Also, I am trying to stay with a small IIR design if at all possible.Make the model of the first order filter as the solution of the differential equation. Especially as in your case you can get solution in the closed form. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by ●October 19, 20102010-10-19
> >Make the model of the first order filter as the solution of the >differential equation. Especially as in your case you can get solution >in the closed form. > > >Vladimir Vassilevsky >DSP and Mixed Signal Design Consultant >http://www.abvolt.comI can easily derive the s-domain differential equation for this filter, lets call it it H(s). But this is where I get stuck mathematically. I could apply the bi-linear transform, but that will give me the wrong answer. In fact, without thinking much about it, that's the first thing I did. But when I looked at the freq response I knew I had done something wrong. So... what exactly should I do next? - Jeff
Reply by ●October 19, 20102010-10-19
sparafucile17 wrote:>>Make the model of the first order filter as the solution of the >>differential equation. Especially as in your case you can get solution >>in the closed form.> I can easily derive the s-domain differential equation for this filter, > lets call it it H(s). But this is where I get stuck mathematically. I > could apply the bi-linear transform, but that will give me the wrong > answer. In fact, without thinking much about it, that's the first thing I > did. But when I looked at the freq response I knew I had done something > wrong.y[n+1] = y[n] + (x[n+1] - y[n]) exp (-dt/T)> So... what exactly should I do next?Write a paycheck to me. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by ●October 19, 20102010-10-19
On 10/19/2010 01:40 PM, sparafucile17 wrote:>> >> Make the model of the first order filter as the solution of the >> differential equation. Especially as in your case you can get solution >> in the closed form. >> >> >> Vladimir Vassilevsky >> DSP and Mixed Signal Design Consultant >> http://www.abvolt.com > > I can easily derive the s-domain differential equation for this filter, > lets call it it H(s). But this is where I get stuck mathematically. I > could apply the bi-linear transform, but that will give me the wrong > answer. In fact, without thinking much about it, that's the first thing I > did. But when I looked at the freq response I knew I had done something > wrong. > > So... what exactly should I do next?An impulse in the DSP, applied to the DAC, becomes a 20us pulse at the DAC output. So find the response of the filter to a 20us pulse: Rp(s) = H(s)/s - e^(-(20us)*s)*H(s)/s = H(s) * (1 - e^(-(20us) * s)) / s Now do all necessary partial fraction expansion on the above to get the time-domain expression rp(t). Note that you'll have a couple of constants that cancel. Note also that you'll just be working with the step response of H(s) and the same step response delayed by 20us -- so if shoving the delay term into the s-domain transfer function confuses you, you can ignore it. Now sample rp(t) at 50kHz to get rp(k). That's the impulse response of the filter _as seen by the processor_. Now find the z transform of rp(k). That's the filter model. Note that I'm not taking delay into account: your processor either doesn't sample the ADC at exactly the same moment that it writes out to the DAC, or it does but it suffers from one whole sample period of delay. Either way, the above model is for an negligent delay, and that's not what you have. If you really want to do this accurately you'll multiply Rp(s) by e^(-delay * s), then proceed to get rp(t), etc. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
Reply by ●October 19, 20102010-10-19
On Oct 19, 4:14�pm, "sparafucile17" <sparafucile17@n_o_s_p_a_m.hotmail.com> wrote:> Hello all, > > Here is my problem: > > My Sample Rate is 50kHz, there is a 1st order analog LPF (simple Resistor > Capacitor) and it's cutoff is 33kHz. �This filter is on the output of my > DACs and then the signal is routed back into the DSP via an ADC running at > the sample rate > > Now, I would like to model this same filter in the DSP but I CANNOT! �The > simple reason is that the cutoff of this analog filter is out-of-band from > my digital domain. �(i.e. 33kHz cutoff is greater than Nyquist of 25kHz). > > Some of you may be saying: "who cares? �It is beyond your digital > bandwidth, so just ignore it." But the problem is that a 1st order filter > has A LOT of rolloff. �I see as much as -2dB at my Nyquist frequency of > 25KHz. �I am trying to model this attenuation inside the DSP AND the phase > response as well. > > If it weren't for the phase part I would just fit a parametric EQ filter or > shelving filter. > > Also, I am trying to stay with a small IIR design if at all possible. > > Thanks, > JeffJeff, What is your output signal bandwidth before the filter? Can you tolerate imaging on the output? Is the output filter also the input filter when route your output back to the ADC? Can you tolerate aliasing on the input? What do you hope to acheive with the filter? Dirk
Reply by ●October 19, 20102010-10-19
> >Now sample rp(t) at 50kHz to get rp(k). That's the impulse response of >the filter _as seen by the processor_. > >Now find the z transform of rp(k). That's the filter model. > > >-- > >Tim Wescott >Wescott Design Services >http://www.wescottdesign.com >Tim, I am following you so far. I can send an impulse out the DAC port and capture this data back inside the DSP at 50kHz which is rp(k). As you said, this is what the processor sees. But this is all time-domain stuff and I'm not sure what techniques I need to use to create the z-transform out of two time-domain signals: 1.) ADC input rp(k) 2.) DAC impulse. The only thing I know of in my DSP bag-of-tricks is the least squares approach. But before I go down that path, I'd like to know if there is something simpler or more straight forward. BTW, I am ignoring group delay for this application so I can focus on the non-linear aspects of the problem. Thanks, Jeff
Reply by ●October 19, 20102010-10-19
> >What is your output signal bandwidth before the filter? Can you >tolerate imaging on the output?My content can go up to 22kHz. Recall that Nyquist is 25kHz.> >Is the output filter also the input filter when route your output back >to the ADC? Can you tolerate aliasing on the input? >In this application I have: (output signal)-->(DAC)-->(33kHz LPF)-->(ADC)-->(input signal)>What do you hope to acheive with the filter? >The filter is there to mitigate EMC issues at high frequencies (In the MHz range) region. I need to understand exactly what voltage and phase the output signal BECOMES after the analog filter. So without overcomplicated the issue I will say that I need to model a 33KHz LPF filter in a system that runs at 50Khz sample rate period.>Dirk >
Reply by ●October 19, 20102010-10-19
Hi All Apologise for the newbie posting! I found lots of info on implementation of filters at http://www.dspguide.com/pdfbook.htm (see ch 14 onwards) Ken
Reply by ●October 19, 20102010-10-19
On Oct 19, 2:58�pm, "sparafucile17" <sparafucile17@n_o_s_p_a_m.hotmail.com> wrote:> >What is your output signal bandwidth before the filter? Can you > >tolerate imaging on the output? > > � � �My content can go up to 22kHz. Recall that Nyquist is 25kHz. > > > > >Is the output filter also the input filter when route your output back > >to the ADC? Can you tolerate aliasing on the input? > > � � �In this application I have: > � � � � (output signal)-->(DAC)-->(33kHz LPF)-->(ADC)-->(input signal) > > >What do you hope to acheive with the filter? > > The filter is there to mitigate EMC issues at high frequencies (In the MHz > range) region. �I need to understand exactly what voltage and phase the > output signal BECOMES after the analog filter. > > So without overcomplicated the issue I will say that I need to model a > 33KHz LPF filter in a system that runs at 50Khz sample rate period. � > > > > >Dirk- Hide quoted text - > > - Show quoted text -If I were you, I�d load the filter appropriately, and then sweep it to ensure that the empirical results matched the expected. Now you can take those results and work the digital model all you want. I�m assuming that what you�re after is the performance of the analog filter for grp dly and pulse response. Hope this helps






