• AVR Freaks

Hot!Really simple DSP high-pass filter question

Author
adown
New Users
  • Total Posts : 32
  • Reward points : 0
  • Joined: 2017/10/19 16:09:17
  • Location: Calgary
  • Status: offline
2018/10/17 13:14:18 (permalink)
0

Really simple DSP high-pass filter question

Good afternoon.  I've worked with DSPs for some time now, but i'm scratching my head at a simple high-pass filter implementation that yields unexpectedly attenuated output.
 
My scenario is simple, i've used the fir1 function in MATLAB to generate 65 coefficients of a LPF.  The freq response shows the passband is 0db, as it should be. 
 
However when i use these coefficients in a HPF application and input a signal that should be well into the passband i get an output that's attenuated by almost 1000.
 
Has anyone else used MATLAB fir1() to generate HPF coefficients, is there a scaling factor or some application detail i've glossed over?
 
-Alexander
#1

2 Replies Related Threads

    du00000001
    Just Some Member
    • Total Posts : 2677
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Really simple DSP high-pass filter question 2018/10/17 13:20:35 (permalink)
    0
    Hi,
    no idea about MATLAB fir*() functions - just some hintvas your LPF seems to work:
    an HPF may as well be considered the input minus the output of the LPF corresponding to the HPF desired. Might be MATLAB has the same opinion and you missed that point. Thus could be that when subtracting the output value from the filter you've got from the input gives the desired result.

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #2
    prmcgill
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2010/10/29 09:54:48
    • Location: 0
    • Status: offline
    Re: Really simple DSP high-pass filter question 2018/10/17 19:26:00 (permalink)
    0
    I realize that it may have been a typo, but you said, "i've used the fir1 function in MATLAB to generate 65 coefficients of a LPF." Then you said, "However when i use these coefficients in a HPF application..." So you designed a low-pass filter and then used it as a high-pass filter? That might give you the 60 dB of attenuation you're seeing. You can only do this if you apply spectral inversion to the LPF coefficients, which you didn't mention.
    #3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5