• Band Stop Filter

    From Rick C@gnuarm.deletethisbit@gmail.com to comp.dsp on Sat Dec 7 13:46:25 2019
    From Newsgroup: comp.dsp

    Someone is using this algorithm for high, low and band pass filter coefficients and wants to adapt it for band stop filters.

    ( y% is an integer value that goes from
    filter length / 2 to +filter length / 2 )

    IF y% = 0 THEN
    c = 1
    ELSE
    IF BandPass THEN
    th1 = (fh - fl) * pi * y% ' Fhigh and Flow of passband
    th2 = (fh + fl) * pi * y%
    c = SIN(th1) * COS(th2) / th1
    ELSE
    th = y% * 2 * pi * fc
    c = SIN(th) / th '
    IF HighPass THEN IF y% MOD 2 = 1 THEN c = -c
    END IF
    END IF

    c is the resulting coefficient for each tap in succession


    Is there a simple equivalent algorithm for this?
    --

    Rick C.

    - Get 1,000 miles of free Supercharging
    - Tesla referral code - https://ts.la/richard11209
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Piergiorgio Sartor@piergiorgio.sartor.this.should.not.be.used@nexgo.REMOVETHIS.de to comp.dsp on Sat Dec 7 23:17:50 2019
    From Newsgroup: comp.dsp

    On 07/12/2019 22.46, Rick C wrote:
    Someone is using this algorithm for high, low and band pass filter coefficients and wants to adapt it for band stop filters.

    ( y% is an integer value that goes from
    filter length / 2 to +filter length / 2 )

    IF y% = 0 THEN
    c = 1
    ELSE
    IF BandPass THEN
    th1 = (fh - fl) * pi * y% ' Fhigh and Flow of passband
    th2 = (fh + fl) * pi * y%
    c = SIN(th1) * COS(th2) / th1
    ELSE
    th = y% * 2 * pi * fc
    c = SIN(th) / th '
    IF HighPass THEN IF y% MOD 2 = 1 THEN c = -c
    END IF
    END IF

    c is the resulting coefficient for each tap in succession


    Is there a simple equivalent algorithm for this?

    I guess that, if bandpass, then 1-bandpass
    is band stop.
    From that it is possible to compute the
    coefficients.

    bye,
    --

    piergiorgio
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Rick C@gnuarm.deletethisbit@gmail.com to comp.dsp on Sun Dec 8 10:21:02 2019
    From Newsgroup: comp.dsp

    On Saturday, December 7, 2019 at 5:19:27 PM UTC-5, Piergiorgio Sartor wrote:
    On 07/12/2019 22.46, Rick C wrote:
    Someone is using this algorithm for high, low and band pass filter coefficients and wants to adapt it for band stop filters.

    ( y% is an integer value that goes from
    filter length / 2 to +filter length / 2 )

    IF y% = 0 THEN
    c = 1
    ELSE
    IF BandPass THEN
    th1 = (fh - fl) * pi * y% ' Fhigh and Flow of passband
    th2 = (fh + fl) * pi * y%
    c = SIN(th1) * COS(th2) / th1
    ELSE
    th = y% * 2 * pi * fc
    c = SIN(th) / th '
    IF HighPass THEN IF y% MOD 2 = 1 THEN c = -c
    END IF
    END IF

    c is the resulting coefficient for each tap in succession


    Is there a simple equivalent algorithm for this?

    I guess that, if bandpass, then 1-bandpass
    is band stop.
    From that it is possible to compute the
    coefficients.

    For a filter with odd length, the "1" would be the tap at the center of the delay line. The algorithm above sets the coefficient of odd length filters to 1, so setting this coefficient to zero and inverting all the other taps would accomplish that.

    What does the "1" look like for even length filters?
    --

    Rick C.

    + Get 1,000 miles of free Supercharging
    + Tesla referral code - https://ts.la/richard11209
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Piergiorgio Sartor@piergiorgio.sartor.this.should.not.be.used@nexgo.REMOVETHIS.de to comp.dsp on Sun Dec 8 19:27:54 2019
    From Newsgroup: comp.dsp

    On 08/12/2019 19.21, Rick C wrote:
    [...]
    For a filter with odd length, the "1" would be the tap at the center of the delay line. The algorithm above sets the coefficient of odd length filters to 1, so setting this coefficient to zero and inverting all the other taps would accomplish that.

    I'm not sure this is correct, but it
    could be.

    I think it is:

    1 - filter_equation

    or

    1 - (ax+...)/(by+....)

    Or whatever the filter equation is.

    What does the "1" look like for even length filters?

    1 is 1, it is the allpass filter.

    I do not think it's relevant to be
    as Dirac with same length.

    But again, it was long time ago, I'm
    not really sure, I just intended to
    give you an hint to search further.

    bye,
    --

    piergiorgio
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Rick C@gnuarm.deletethisbit@gmail.com to comp.dsp on Sun Dec 8 12:16:56 2019
    From Newsgroup: comp.dsp

    On Sunday, December 8, 2019 at 1:28:34 PM UTC-5, Piergiorgio Sartor wrote:
    On 08/12/2019 19.21, Rick C wrote:
    [...]
    For a filter with odd length, the "1" would be the tap at the center of the delay line. The algorithm above sets the coefficient of odd length filters to 1, so setting this coefficient to zero and inverting all the other taps would accomplish that.

    I'm not sure this is correct, but it
    could be.

    I think it is:

    1 - filter_equation

    or

    1 - (ax+...)/(by+....)

    Or whatever the filter equation is.

    What does the "1" look like for even length filters?

    1 is 1, it is the allpass filter.

    I do not think it's relevant to be
    as Dirac with same length.

    But again, it was long time ago, I'm
    not really sure, I just intended to
    give you an hint to search further.

    The context is not the basic equation, but rather the filter coefficients. For the odd length filters in this algorithm the center coefficient is 1. I'm asking what the coefficients would be for an even length filter for an allpass.
    --

    Rick C.

    - Get 1,000 miles of free Supercharging
    - Tesla referral code - https://ts.la/richard11209
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Piergiorgio Sartor@piergiorgio.sartor.this.should.not.be.used@nexgo.REMOVETHIS.de to comp.dsp on Sun Dec 8 22:06:56 2019
    From Newsgroup: comp.dsp

    On 08/12/2019 21.16, Rick C wrote:
    [...]
    The context is not the basic equation, but rather the filter coefficients. For the odd length filters in this algorithm the center coefficient is 1. I'm asking what the coefficients would be for an even length filter for an allpass.


    The coefficients must be applied to
    an equation.

    What it is?
    FIR? IIR?

    The rest will be automatically, I guess.

    Nevertheless, as wrote before, this was
    just an hint.

    bye,
    --

    piergiorgio
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Rick C@gnuarm.deletethisbit@gmail.com to comp.dsp on Sun Dec 8 22:59:07 2019
    From Newsgroup: comp.dsp

    On Sunday, December 8, 2019 at 4:09:29 PM UTC-5, Piergiorgio Sartor wrote:
    On 08/12/2019 21.16, Rick C wrote:
    [...]
    The context is not the basic equation, but rather the filter coefficients. For the odd length filters in this algorithm the center coefficient is 1. I'm asking what the coefficients would be for an even length filter for an allpass.


    The coefficients must be applied to
    an equation.

    What it is?
    FIR? IIR?

    The rest will be automatically, I guess.

    Nevertheless, as wrote before, this was
    just an hint.

    bye,

    --

    piergiorgio

    Did you not read the first post where I provided the code to produce the coefficients? Was that not clear?
    --

    Rick C.

    -- Get 1,000 miles of free Supercharging
    -- Tesla referral code - https://ts.la/richard11209
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Richard (Rick) Lyons@r.lyons@ieee.org to comp.dsp on Mon Dec 9 01:26:57 2019
    From Newsgroup: comp.dsp


    Rick C.
    You're being unreasonable by posting uncommented code here and then expecting someone to "simplify" that code for you. Then as Piergiorgio struggles to try to help, you replied to him in a rude way.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Piergiorgio Sartor@piergiorgio.sartor.this.should.not.be.used@nexgo.REMOVETHIS.de to comp.dsp on Mon Dec 9 19:36:39 2019
    From Newsgroup: comp.dsp

    On 09/12/2019 07.59, Rick C wrote:
    [...]
    Did you not read the first post where I provided the code to produce the coefficients? Was that not clear?

    No, I do not usually read code posted
    on usenet.

    I can try to point you one way which
    might, or might not, help in solving
    your problem, but I will not debug,
    extend, improve or else some code.

    For that, you'll have to pay... :-)

    Sorry...

    bye,
    --

    piergiorgio
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Rick C@gnuarm.deletethisbit@gmail.com to comp.dsp on Mon Dec 9 18:46:53 2019
    From Newsgroup: comp.dsp

    On Monday, December 9, 2019 at 4:27:01 AM UTC-5, Richard (Rick) Lyons wrote:
    Rick C.
    You're being unreasonable by posting uncommented code here and then expecting someone to "simplify" that code for you. Then as Piergiorgio struggles to try to help, you replied to him in a rude way.
    Sorry if anyone thought I was rude. I was asking what was not clear about the code.
    Not sure what you mean about "simplifying" the code. I listed the rather simple and straightforward code so it could be seen how the coefficients are being generated. I don't even know what the language is and I was able to undertstand was it was doing to a large degree.
    Sorry if my posts are not appropriate. I'm not sure what to say that would be better.
    --
    Rick C.
    -+ Get 1,000 miles of free Supercharging
    -+ Tesla referral code - https://ts.la/richard11209
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Rick C@gnuarm.deletethisbit@gmail.com to comp.dsp on Mon Dec 9 18:49:43 2019
    From Newsgroup: comp.dsp

    On Monday, December 9, 2019 at 1:40:18 PM UTC-5, Piergiorgio Sartor wrote:
    On 09/12/2019 07.59, Rick C wrote:
    [...]
    Did you not read the first post where I provided the code to produce the coefficients? Was that not clear?

    No, I do not usually read code posted
    on usenet.

    I can try to point you one way which
    might, or might not, help in solving
    your problem, but I will not debug,
    extend, improve or else some code.

    For that, you'll have to pay... :-)

    Sorry...

    Ok, that's fine. But I'm not asking you to debug code. In particular this code is working to the best of my knowledge. I only posted it so you could see what is being done presently.

    If you go back and read my post I'm pretty sure I'm only asking about what coefficients are used for a type of filter. I didn't ask anyone to write, alter or debug any code.
    --

    Rick C.

    +- Get 1,000 miles of free Supercharging
    +- Tesla referral code - https://ts.la/richard11209
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Rick C@gnuarm.deletethisbit@gmail.com to comp.dsp on Mon Dec 9 18:56:19 2019
    From Newsgroup: comp.dsp

    On Monday, December 9, 2019 at 9:49:47 PM UTC-5, Rick C wrote:
    On Monday, December 9, 2019 at 1:40:18 PM UTC-5, Piergiorgio Sartor wrote:
    On 09/12/2019 07.59, Rick C wrote:
    [...]
    Did you not read the first post where I provided the code to produce the coefficients? Was that not clear?

    No, I do not usually read code posted
    on usenet.

    I can try to point you one way which
    might, or might not, help in solving
    your problem, but I will not debug,
    extend, improve or else some code.

    For that, you'll have to pay... :-)

    Sorry...

    Ok, that's fine. But I'm not asking you to debug code. In particular this code is working to the best of my knowledge. I only posted it so you could see what is being done presently.

    When I say "what is being done presently", I mean what coefficients are being used. Is that more clear? I'm not sure why my questions are not being understood as I intended them.

    I'm asking a question about the design of the filter coefficients, not about the code. BTW, it is a FIR filter. I don't see an indication if the intent is to limit the tool to odd length filters or to be general purpose for all filter lengths.

    Sorry, I thought this was pretty close to a filter design 101 question and it would not be hard for anyone to answer. If this is not appropriate, that's ok.
    --

    Rick C.

    ++ Get 1,000 miles of free Supercharging
    ++ Tesla referral code - https://ts.la/richard11209
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From theman@theman@ericjacobsen.org (Eric Jacobsen) to comp.dsp on Wed Dec 11 16:44:32 2019
    From Newsgroup: comp.dsp

    On Mon, 9 Dec 2019 18:46:53 -0800 (PST), Rick C <gnuarm.deletethisbit@gmail.com> wrote:

    On Monday, December 9, 2019 at 4:27:01 AM UTC-5, Richard (Rick) Lyons wrote= >:
    Rick C.
    You're being unreasonable by posting uncommented code here and then expec= >ting someone to "simplify" that code for you. Then as Piergiorgio struggles=
    to try to help, you replied to him in a rude way.

    Sorry if anyone thought I was rude. I was asking what was not clear about = >the code.=20

    Not sure what you mean about "simplifying" the code. I listed the rather s= >imple and straightforward code so it could be seen how the coefficients are=
    being generated. I don't even know what the language is and I was able to= undertstand was it was doing to a large degree. =20

    Sorry if my posts are not appropriate. I'm not sure what to say that would=
    be better.=20

    --=20

    Rick C.

    -+ Get 1,000 miles of free Supercharging
    -+ Tesla referral code - https://ts.la/richard11209

    Your posts are not inappropriate and asking questions, even questions
    about code, is fine. There will be a lot of folks, however, like
    Piergiorgio and myself and many others, who just find reading somebody
    else's code a struggle in itself.

    Everybody thinks code they've written is straightforward, because they
    wrote it, but it's not obvious or easy to everybody else. I don't
    even know what language that code is, or at least the syntax isn't
    immediately obvious to me, and figuring it out and how the
    coefficients are generated is just not how I want to spend any of my
    time.

    It might be easy, but it isn't obvious enough to pass the
    investigation threshold for some of us. That said, maybe somebody
    else will come along and give it a shot.

    But don't be discouraged from asking questions or posting problems.
    And don't let the old grumpy guys like me slow you down just because
    we're not willing to do something.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Rick C@gnuarm.deletethisbit@gmail.com to comp.dsp on Thu Dec 12 11:07:19 2019
    From Newsgroup: comp.dsp

    On Wednesday, December 11, 2019 at 11:44:36 AM UTC-5, Eric Jacobsen wrote:
    On Mon, 9 Dec 2019 18:46:53 -0800 (PST), Rick C <gnuarm.deletethisbit@gmail.com> wrote:

    On Monday, December 9, 2019 at 4:27:01 AM UTC-5, Richard (Rick) Lyons wrote= >:
    Rick C.
    You're being unreasonable by posting uncommented code here and then expec= >ting someone to "simplify" that code for you. Then as Piergiorgio struggles=
    to try to help, you replied to him in a rude way.

    Sorry if anyone thought I was rude. I was asking what was not clear about = >the code.=20

    Not sure what you mean about "simplifying" the code. I listed the rather s= >imple and straightforward code so it could be seen how the coefficients are=
    being generated. I don't even know what the language is and I was able to= undertstand was it was doing to a large degree. =20

    Sorry if my posts are not appropriate. I'm not sure what to say that would=
    be better.=20

    --=20

    Rick C.

    -+ Get 1,000 miles of free Supercharging
    -+ Tesla referral code - https://ts.la/richard11209

    Your posts are not inappropriate and asking questions, even questions
    about code, is fine. There will be a lot of folks, however, like Piergiorgio and myself and many others, who just find reading somebody
    else's code a struggle in itself.

    Everybody thinks code they've written is straightforward, because they
    wrote it, but it's not obvious or easy to everybody else. I don't
    even know what language that code is, or at least the syntax isn't immediately obvious to me, and figuring it out and how the
    coefficients are generated is just not how I want to spend any of my
    time.

    It might be easy, but it isn't obvious enough to pass the
    investigation threshold for some of us. That said, maybe somebody
    else will come along and give it a shot.

    But don't be discouraged from asking questions or posting problems.
    And don't let the old grumpy guys like me slow you down just because
    we're not willing to do something.
    Thanks for the reply.
    I am surprised that anyone would say the code is not immediately obvious. I didn't write the code and I have no idea what language it is written in, I suspect one of those math manipulation tools like Mathcad or something similar. The idea of the program is to generate the coefficients for a FIR filter.
    The structure of the program is controlled by conditionals with an outer loop that is not specified, but implied by the opening comment that says, "y% is an integer value that goes from filter length / 2 to +filter length / 2".
    The first conditional is for y=0 which would only be true for an odd length filter. Inside the ELSE is a conditional for the filter type being a BANDPASS. The bandpass coefficients are calculated here. Other filter types are calculated in the ELSE clause for that, but none of this is important for my question.
    The question I asked only pertained to the issue of the filter coefficients for an even length filter. To change a bandpass filter to a band reject filter the y=0 coefficient is changed to a 0 rather than a 1 and each other coefficient is negated. This is the coefficient equivalent of subtracting the bandpass filter from the allpass filter (c(0)=1, else c(x)=0).
    If the filter length is even what does the all pass filter look like?
    --
    Rick C.
    --- Get 1,000 miles of free Supercharging
    --- Tesla referral code - https://ts.la/richard11209
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From theman@theman@ericjacobsen.org (Eric Jacobsen) to comp.dsp on Thu Dec 12 23:59:45 2019
    From Newsgroup: comp.dsp

    On Thu, 12 Dec 2019 11:07:19 -0800 (PST), Rick C <gnuarm.deletethisbit@gmail.com> wrote:

    On Wednesday, December 11, 2019 at 11:44:36 AM UTC-5, Eric Jacobsen wrote:
    On Mon, 9 Dec 2019 18:46:53 -0800 (PST), Rick C
    <gnuarm.deletethisbit@gmail.com> wrote:
    =20
    On Monday, December 9, 2019 at 4:27:01 AM UTC-5, Richard (Rick) Lyons wr= >ote=3D
    :
    Rick C.
    You're being unreasonable by posting uncommented code here and then ex= >pec=3D
    ting someone to "simplify" that code for you. Then as Piergiorgio strugg= >les=3D
    to try to help, you replied to him in a rude way.

    Sorry if anyone thought I was rude. I was asking what was not clear abo= >ut =3D
    the code.=3D20

    Not sure what you mean about "simplifying" the code. I listed the rathe= >r s=3D
    imple and straightforward code so it could be seen how the coefficients = >are=3D
    being generated. I don't even know what the language is and I was able=
    to=3D
    undertstand was it was doing to a large degree. =3D20

    Sorry if my posts are not appropriate. I'm not sure what to say that wo= >uld=3D
    be better.=3D20

    --=3D20

    Rick C.

    -+ Get 1,000 miles of free Supercharging
    -+ Tesla referral code - https://ts.la/richard11209
    =20
    Your posts are not inappropriate and asking questions, even questions
    about code, is fine. There will be a lot of folks, however, like
    Piergiorgio and myself and many others, who just find reading somebody
    else's code a struggle in itself.
    =20
    Everybody thinks code they've written is straightforward, because they
    wrote it, but it's not obvious or easy to everybody else. I don't
    even know what language that code is, or at least the syntax isn't
    immediately obvious to me, and figuring it out and how the
    coefficients are generated is just not how I want to spend any of my
    time.
    =20
    It might be easy, but it isn't obvious enough to pass the
    investigation threshold for some of us. That said, maybe somebody
    else will come along and give it a shot.
    =20
    But don't be discouraged from asking questions or posting problems.
    And don't let the old grumpy guys like me slow you down just because
    we're not willing to do something.

    Thanks for the reply.=20

    I am surprised that anyone would say the code is not immediately obvious. =

    Hence the disconnect.

    For example, in the leading comment:

    y% is an integer value that goes from
    filter length / 2 to +filter length / 2 )

    The % has specific meaning in some languages, but do those meanings
    apply here? I've no idea.

    y% can't be an integer value for "filter length/2" for odd filter
    lengths, so does that mean the intent is to reject all even lengths?
    I've no idea, and it's not wise to assume, so many will just pass.

    Even if you get past the above, the value runs from:

    filter length / 2

    to

    +filter length / 2

    So, it doesn't run? Or it just has one, singular value?

    I've no idea.

    So, yeah, it's not obvious, even getting past the very first comment.

    One could make assumptions, but that's usually not productive.

    When it's clear as mud, you need to be willing to wade throug the mud,
    and many aren't.




    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Rick C@gnuarm.deletethisbit@gmail.com to comp.dsp on Thu Dec 12 19:59:30 2019
    From Newsgroup: comp.dsp

    On Thursday, December 12, 2019 at 6:59:49 PM UTC-5, Eric Jacobsen wrote:
    On Thu, 12 Dec 2019 11:07:19 -0800 (PST), Rick C <gnuarm.deletethisbit@gmail.com> wrote:

    On Wednesday, December 11, 2019 at 11:44:36 AM UTC-5, Eric Jacobsen wrote: >> On Mon, 9 Dec 2019 18:46:53 -0800 (PST), Rick C
    <gnuarm.deletethisbit@gmail.com> wrote:
    =20
    On Monday, December 9, 2019 at 4:27:01 AM UTC-5, Richard (Rick) Lyons wr= >ote=3D
    :
    Rick C.
    You're being unreasonable by posting uncommented code here and then ex= >pec=3D
    ting someone to "simplify" that code for you. Then as Piergiorgio strugg= >les=3D
    to try to help, you replied to him in a rude way.

    Sorry if anyone thought I was rude. I was asking what was not clear abo= >ut =3D
    the code.=3D20

    Not sure what you mean about "simplifying" the code. I listed the rathe= >r s=3D
    imple and straightforward code so it could be seen how the coefficients = >are=3D
    being generated. I don't even know what the language is and I was able=
    to=3D
    undertstand was it was doing to a large degree. =3D20

    Sorry if my posts are not appropriate. I'm not sure what to say that wo= >uld=3D
    be better.=3D20

    --=3D20

    Rick C.

    -+ Get 1,000 miles of free Supercharging
    -+ Tesla referral code - https://ts.la/richard11209
    =20
    Your posts are not inappropriate and asking questions, even questions
    about code, is fine. There will be a lot of folks, however, like
    Piergiorgio and myself and many others, who just find reading somebody
    else's code a struggle in itself.
    =20
    Everybody thinks code they've written is straightforward, because they
    wrote it, but it's not obvious or easy to everybody else. I don't
    even know what language that code is, or at least the syntax isn't
    immediately obvious to me, and figuring it out and how the
    coefficients are generated is just not how I want to spend any of my
    time.
    =20
    It might be easy, but it isn't obvious enough to pass the
    investigation threshold for some of us. That said, maybe somebody
    else will come along and give it a shot.
    =20
    But don't be discouraged from asking questions or posting problems.
    And don't let the old grumpy guys like me slow you down just because
    we're not willing to do something.

    Thanks for the reply.=20

    I am surprised that anyone would say the code is not immediately obvious. =

    Hence the disconnect.

    For example, in the leading comment:

    y% is an integer value that goes from
    filter length / 2 to +filter length / 2 )

    The % has specific meaning in some languages, but do those meanings
    apply here? I've no idea.
    I guess some people are more intuitive than others. I don't see how the percent sign is even relevant when reading that comment. The important point is that the variable is stepped through the range of filter length which is a symmetrical range.
    Why would you even be trying to understand details of the language when reading through this code to understand what the intent is? Obviously you can't discern the details of the language. Why even try?
    y% can't be an integer value for "filter length/2" for odd filter
    lengths, so does that mean the intent is to reject all even lengths?
    Of course it can be integer. What is 11/2? 5! I don't know if that is what they are using to calculate the coefficients or not. It may be that this is only for odd length filters. I don't know and I don't really care much.
    I've no idea, and it's not wise to assume, so many will just pass.
    That's fine. But assumption is exactly what is needed here, but not about the parts you are having trouble with. Those parts can be ignored at first.
    Not trying to be rude or judgemental or anything negative. I recall in elementary school I would be very literal about the things I read. If I didn't understand a word or a phrase I would stop. I was taught to read a first pass to get some idea of what was being said. Then I could go back to see if it made more sense.
    Even if you get past the above, the value runs from:

    filter length / 2

    to

    +filter length / 2

    So, it doesn't run? Or it just has one, singular value?

    I've no idea.
    Not clear what you are trying to say. The code does not have any looping construct to increment the value, so the assumption is that that is done in some other aspect of the code or tool that aren't shown here.
    The part you are getting hung up on is the index for the filter coefficients. I don't understand what is unclear about that. Once you know that - everything else about the index in the code should be clear. No? Not that it matters though.
    So, yeah, it's not obvious, even getting past the very first comment.

    One could make assumptions, but that's usually not productive.

    When it's clear as mud, you need to be willing to wade throug the mud,
    and many aren't.
    What mud? You don't even need to look at the code other than to realize they are calculating filter coefficients and the center tap coefficient for the odd length filter is a 1 which I pointed out. At that point I said the coefficients for an odd length allpass filter were all zero except for a 1 at the center tap. I asked what the filter coefficients would be if the allpass filter were even length. No inspection of the code is needed for that.
    Is the question not clear?
    --
    Rick C.
    --+ Get 1,000 miles of free Supercharging
    --+ Tesla referral code - https://ts.la/richard11209
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Christian Gollwitzer@auriocus@gmx.de to comp.dsp on Fri Dec 13 08:23:08 2019
    From Newsgroup: comp.dsp

    Am 13.12.19 um 04:59 schrieb Rick C:
    On Thursday, December 12, 2019 at 6:59:49 PM UTC-5, Eric Jacobsen wrote:
    On Thu, 12 Dec 2019 11:07:19 -0800 (PST), Rick C>

    y% can't be an integer value for "filter length/2" for odd filter
    lengths, so does that mean the intent is to reject all even lengths?

    Of course it can be integer. What is 11/2? 5! I don't know if that is what they are using to calculate the coefficients or not.

    You can never have an even length filter then. If it runs from -f/2 to
    +f/2, there is always the zero in the middle, by definition you create
    an odd number of coefficients.

    It may be that this is only for odd length filters. I don't know and I don't really care much.

    You'll have to understand that we care much less than you abou this problem.


    Christian
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Rick C@gnuarm.deletethisbit@gmail.com to comp.dsp on Sat Dec 14 18:20:25 2019
    From Newsgroup: comp.dsp

    On Friday, December 13, 2019 at 2:23:14 AM UTC-5, Christian Gollwitzer wrote:
    Am 13.12.19 um 04:59 schrieb Rick C:
    On Thursday, December 12, 2019 at 6:59:49 PM UTC-5, Eric Jacobsen wrote:
    On Thu, 12 Dec 2019 11:07:19 -0800 (PST), Rick C>

    y% can't be an integer value for "filter length/2" for odd filter
    lengths, so does that mean the intent is to reject all even lengths?

    Of course it can be integer. What is 11/2? 5! I don't know if that is what they are using to calculate the coefficients or not.

    You can never have an even length filter then. If it runs from -f/2 to
    +f/2, there is always the zero in the middle, by definition you create
    an odd number of coefficients.

    It may be that this is only for odd length filters. I don't know and I don't really care much.

    You'll have to understand that we care much less than you abou this problem.


    Christian

    Which problem is that exactly?
    --

    Rick C.

    -+- Get 1,000 miles of free Supercharging
    -+- Tesla referral code - https://ts.la/richard11209
    --- Synchronet 3.22a-Linux NewsLink 1.2