Reply by Eric Jacobsen December 15, 20192019-12-15
On Sat, 14 Dec 2019 18:24:08 -0800 (PST), Rick C
<gnuarm.deletethisbit@gmail.com> wrote:

>On Saturday, December 14, 2019 at 5:52:32 PM UTC-5, Eric Jacobsen wrote: >> On Thu, 12 Dec 2019 19:59:30 -0800 (PST), Rick C >> <gnuarm.deletethisbit@gmail.com> wrote: >> >> >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: >> >>=20 >> >> >On Wednesday, December 11, 2019 at 11:44:36 AM UTC-5, Eric Jacobsen wrot= >> >e: >> >> >> On Mon, 9 Dec 2019 18:46:53 -0800 (PST), Rick C >> >> >> <gnuarm.deletethisbit@gmail.com> wrote: >> >> >>=3D20 >> >> >> >On Monday, December 9, 2019 at 4:27:01 AM UTC-5, Richard (Rick) Lyons= >> > wr=3D >> >> >ote=3D3D >> >> >> >: >> >> >> >> Rick C. >> >> >> >> You're being unreasonable by posting uncommented code here and then= >> > ex=3D >> >> >pec=3D3D >> >> >> >ting someone to "simplify" that code for you. Then as Piergiorgio str= >> >ugg=3D >> >> >les=3D3D >> >> >> > 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=3D >> >> >ut =3D3D >> >> >> >the code.=3D3D20 >> >> >> > >> >> >> >Not sure what you mean about "simplifying" the code. I listed the ra= >> >the=3D >> >> >r s=3D3D >> >> >> >imple and straightforward code so it could be seen how the coefficien= >> >ts =3D >> >> >are=3D3D >> >> >> > being generated. I don't even know what the language is and I was a= >> >ble=3D >> >> > to=3D3D >> >> >> > undertstand was it was doing to a large degree. =3D3D20 >> >> >> > >> >> >> >Sorry if my posts are not appropriate. I'm not sure what to say that= >> > wo=3D >> >> >uld=3D3D >> >> >> > be better.=3D3D20 >> >> >> > >> >> >> >--=3D3D20 >> >> >> > >> >> >> > Rick C. >> >> >> > >> >> >> > -+ Get 1,000 miles of free Supercharging >> >> >> > -+ Tesla referral code - https://ts.la/richard11209 >> >> >>=3D20 >> >> >> 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. >> >> >>=3D20 >> >> >> 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. >> >> >>=3D20 >> >> >> 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. >> >> >>=3D20 >> >> >> 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.=3D20 >> >> > >> >> >I am surprised that anyone would say the code is not immediately obvious= >> >. =3D >> >>=20 >> >> Hence the disconnect. >> >>=20 >> >> For example, in the leading comment: >> >>=20 >> >> y% is an integer value that goes from >> >> filter length / 2 to +filter length / 2 ) >> >>=20 >> >> 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 pe= >> >rcent sign is even relevant when reading that comment. The important point= >> > is that the variable is stepped through the range of filter length which i= >> >s a symmetrical range. =20 >> >> The percent sign appears in the code, so is very relevant to >> attempting to understand what it means. >> >> The range, as shown, may not be symmetrical, depending on what is >> meant. When it comes to ambiguous code, assumptions are often >> counterproductive. >> >> >Why would you even be trying to understand details of the language when rea= >> >ding through this code to understand what the intent is? Obviously you can= >> >'t discern the details of the language. Why even try?=20 >> >> That's why many don't. >> >> > >> >> 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 wh= >> >at they are using to calculate the coefficients or not. It may be that thi= >> >s is only for odd length filters. I don't know and I don't really care muc= >> >h. =20 >> >> Then I'm glad I didn't spend any time trying to understand it. >> > >> >> 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= >> >. =20 >> > >> >Not trying to be rude or judgemental or anything negative. I recall in ele= >> >mentary 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.=20 >> >> That's great with people, but you posted code. Computers don't do >> nuance, they are the epitome of literal, so asking somebody to analyze >> a chunk of code requires understanding of how that code will be >> executed. Since it doesn't appear to be a very common language, if >> it's even a language and not pseudo-code, but I don't really know >> which, it's hard to say what it'll do without knowing the details of >> how the code will be executed. >> >> e.g., does it round up? down? toward zero? away from zero? You >> stated previously 11/2 = 5, but there's no way to know that and you >> certainly didn't state it previously. And that's a critical thing to >> know to understand how many or what coefficients would be generated. >> >> > >> >> Even if you get past the above, the value runs from: >> >>=20 >> >> filter length / 2=20 >> >>=20 >> >> to=20 >> >>=20 >> >> +filter length / 2 >> >>=20 >> >> So, it doesn't run? Or it just has one, singular value? >> >>=20 >> >> I've no idea. >> > >> >Not clear what you are trying to say. The code does not have any looping c= >> >onstruct 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. =20 >> >> Another unstated assumption. >> >> >The part you are getting hung up on is the index for the filter coefficient= >> >s. I don't understand what is unclear about that. Once you know that - ev= >> >erything else about the index in the code should be clear. No? Not that i= >> >t matters though. =20 >> >> No. >> >> > >> >> So, yeah, it's not obvious, even getting past the very first comment. >> >>=20 >> >> One could make assumptions, but that's usually not productive. >> >>=20 >> >> When it's clear as mud, you need to be willing to wade throug the mud, >> >> and many aren't. >> > >> >What mud? >> >> The points I made previously regarding the ambiguity of interpreting >> the code. You have since pointed out additional ambiguity. >> >> >You don't even need to look at the code other than to realize th= >> >ey are calculating filter coefficients and the center tap coefficient for t= >> >he 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 a= >> >llpass filter were even length. No inspection of the code is needed for th= >> >at. =20 >> > >> >Is the question not clear? =20 >> >> Apparently not. >> >> However, if your filter coefficients for the odd-length all-pass are a >> one at the center tap with zeros on either side, you can make it an >> even-length all-pass with exactly the same frequency response by >> deleting any one of the zeros. >> >> I hope that helps. > >Not really. I could produce an all pass filter by setting any one coefficient to a 1 and the rest to zero. But they will all have different delays. The point is to have an all pass that the band pass would be subtracted from. > >It is amazing to me how much effort people have spent explaining how little effort they are willing to spend to understand the question and help.
I think if you'd put the effort into clarifying the question initially, which now seems to be quite different than your initial post, you may have gotten more useful responses. I'm still not quite sure what you're after, whether you want to know how to subtract frequency responses in the time domain, which is not trivial, or you want the initial code modified to create bandstop coefficients (which seems to be what you first asked for, hence people telling you they don't want to reverse-engineer strange code of an unknown language), or you want to be pointed toward a bandstop algorithm similar to what you posted, or something related but not quite clear yet. There are still a number of very knowledgable people here, but you're not going to get a useful answer if your question isn't clear or wasn't the question you meant to ask or if you ask for work beyond what people are willing to do for free. I hope you got your money's worth. Oh, wait... ;)
Reply by Rick C December 14, 20192019-12-14
On Saturday, December 14, 2019 at 5:52:32 PM UTC-5, Eric Jacobsen wrote:
> On Thu, 12 Dec 2019 19:59:30 -0800 (PST), Rick C > <gnuarm.deletethisbit@gmail.com> wrote: > > >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 wrot> >e: > >> >> 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 str> >ugg= > >> >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 ra> >the= > >> >r s=3D > >> >> >imple and straightforward code so it could be seen how the coefficien> >ts = > >> >are=3D > >> >> > being generated. I don't even know what the language is and I was a> >ble= > >> > 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 pe> >rcent sign is even relevant when reading that comment. The important point> > is that the variable is stepped through the range of filter length which i> >s a symmetrical range. > > The percent sign appears in the code, so is very relevant to > attempting to understand what it means. > > The range, as shown, may not be symmetrical, depending on what is > meant. When it comes to ambiguous code, assumptions are often > counterproductive. > > >Why would you even be trying to understand details of the language when rea> >ding through this code to understand what the intent is? Obviously you can> >'t discern the details of the language. Why even try? > > That's why many don't. > > > > >> 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 wh> >at they are using to calculate the coefficients or not. It may be that thi> >s is only for odd length filters. I don't know and I don't really care muc> >h. > > Then I'm glad I didn't spend any time trying to understand it. > > > >> 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 ele> >mentary 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. > > That's great with people, but you posted code. Computers don't do > nuance, they are the epitome of literal, so asking somebody to analyze > a chunk of code requires understanding of how that code will be > executed. Since it doesn't appear to be a very common language, if > it's even a language and not pseudo-code, but I don't really know > which, it's hard to say what it'll do without knowing the details of > how the code will be executed. > > e.g., does it round up? down? toward zero? away from zero? You > stated previously 11/2 = 5, but there's no way to know that and you > certainly didn't state it previously. And that's a critical thing to > know to understand how many or what coefficients would be generated. > > > > >> 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 c> >onstruct 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. > > Another unstated assumption. > > >The part you are getting hung up on is the index for the filter coefficient> >s. I don't understand what is unclear about that. Once you know that - ev> >erything else about the index in the code should be clear. No? Not that i> >t matters though. > > No. > > > > >> 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? > > The points I made previously regarding the ambiguity of interpreting > the code. You have since pointed out additional ambiguity. > > >You don't even need to look at the code other than to realize th> >ey are calculating filter coefficients and the center tap coefficient for t> >he 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 a> >llpass filter were even length. No inspection of the code is needed for th> >at. > > > >Is the question not clear? > > Apparently not. > > However, if your filter coefficients for the odd-length all-pass are a > one at the center tap with zeros on either side, you can make it an > even-length all-pass with exactly the same frequency response by > deleting any one of the zeros. > > I hope that helps.
Not really. I could produce an all pass filter by setting any one coefficient to a 1 and the rest to zero. But they will all have different delays. The point is to have an all pass that the band pass would be subtracted from. It is amazing to me how much effort people have spent explaining how little effort they are willing to spend to understand the question and help. Ok, enough said. Thanks anyway. -- Rick C. -++ Get 1,000 miles of free Supercharging -++ Tesla referral code - https://ts.la/richard11209
Reply by Rick C December 14, 20192019-12-14
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
Reply by Eric Jacobsen December 14, 20192019-12-14
On Thu, 12 Dec 2019 19:59:30 -0800 (PST), Rick C
<gnuarm.deletethisbit@gmail.com> wrote:

>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: >>=20 >> >On Wednesday, December 11, 2019 at 11:44:36 AM UTC-5, Eric Jacobsen wrot= >e: >> >> On Mon, 9 Dec 2019 18:46:53 -0800 (PST), Rick C >> >> <gnuarm.deletethisbit@gmail.com> wrote: >> >>=3D20 >> >> >On Monday, December 9, 2019 at 4:27:01 AM UTC-5, Richard (Rick) Lyons= > wr=3D >> >ote=3D3D >> >> >: >> >> >> Rick C. >> >> >> You're being unreasonable by posting uncommented code here and then= > ex=3D >> >pec=3D3D >> >> >ting someone to "simplify" that code for you. Then as Piergiorgio str= >ugg=3D >> >les=3D3D >> >> > 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=3D >> >ut =3D3D >> >> >the code.=3D3D20 >> >> > >> >> >Not sure what you mean about "simplifying" the code. I listed the ra= >the=3D >> >r s=3D3D >> >> >imple and straightforward code so it could be seen how the coefficien= >ts =3D >> >are=3D3D >> >> > being generated. I don't even know what the language is and I was a= >ble=3D >> > to=3D3D >> >> > undertstand was it was doing to a large degree. =3D3D20 >> >> > >> >> >Sorry if my posts are not appropriate. I'm not sure what to say that= > wo=3D >> >uld=3D3D >> >> > be better.=3D3D20 >> >> > >> >> >--=3D3D20 >> >> > >> >> > Rick C. >> >> > >> >> > -+ Get 1,000 miles of free Supercharging >> >> > -+ Tesla referral code - https://ts.la/richard11209 >> >>=3D20 >> >> 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. >> >>=3D20 >> >> 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. >> >>=3D20 >> >> 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. >> >>=3D20 >> >> 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.=3D20 >> > >> >I am surprised that anyone would say the code is not immediately obvious= >. =3D >>=20 >> Hence the disconnect. >>=20 >> For example, in the leading comment: >>=20 >> y% is an integer value that goes from >> filter length / 2 to +filter length / 2 ) >>=20 >> 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 pe= >rcent sign is even relevant when reading that comment. The important point= > is that the variable is stepped through the range of filter length which i= >s a symmetrical range. =20
The percent sign appears in the code, so is very relevant to attempting to understand what it means. The range, as shown, may not be symmetrical, depending on what is meant. When it comes to ambiguous code, assumptions are often counterproductive.
>Why would you even be trying to understand details of the language when rea= >ding through this code to understand what the intent is? Obviously you can= >'t discern the details of the language. Why even try?=20
That's why many don't.
> >> 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 wh= >at they are using to calculate the coefficients or not. It may be that thi= >s is only for odd length filters. I don't know and I don't really care muc= >h. =20
Then I'm glad I didn't spend any time trying to understand it.
> >> 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= >. =20 > >Not trying to be rude or judgemental or anything negative. I recall in ele= >mentary 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.=20
That's great with people, but you posted code. Computers don't do nuance, they are the epitome of literal, so asking somebody to analyze a chunk of code requires understanding of how that code will be executed. Since it doesn't appear to be a very common language, if it's even a language and not pseudo-code, but I don't really know which, it's hard to say what it'll do without knowing the details of how the code will be executed. e.g., does it round up? down? toward zero? away from zero? You stated previously 11/2 = 5, but there's no way to know that and you certainly didn't state it previously. And that's a critical thing to know to understand how many or what coefficients would be generated.
> >> Even if you get past the above, the value runs from: >>=20 >> filter length / 2=20 >>=20 >> to=20 >>=20 >> +filter length / 2 >>=20 >> So, it doesn't run? Or it just has one, singular value? >>=20 >> I've no idea. > >Not clear what you are trying to say. The code does not have any looping c= >onstruct 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. =20
Another unstated assumption.
>The part you are getting hung up on is the index for the filter coefficient= >s. I don't understand what is unclear about that. Once you know that - ev= >erything else about the index in the code should be clear. No? Not that i= >t matters though. =20
No.
> >> So, yeah, it's not obvious, even getting past the very first comment. >>=20 >> One could make assumptions, but that's usually not productive. >>=20 >> When it's clear as mud, you need to be willing to wade throug the mud, >> and many aren't. > >What mud?
The points I made previously regarding the ambiguity of interpreting the code. You have since pointed out additional ambiguity.
>You don't even need to look at the code other than to realize th= >ey are calculating filter coefficients and the center tap coefficient for t= >he 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 a= >llpass filter were even length. No inspection of the code is needed for th= >at. =20 > >Is the question not clear? =20
Apparently not. However, if your filter coefficients for the odd-length all-pass are a one at the center tap with zeros on either side, you can make it an even-length all-pass with exactly the same frequency response by deleting any one of the zeros. I hope that helps.
>--=20 > > Rick C. > > --+ Get 1,000 miles of free Supercharging > --+ Tesla referral code - https://ts.la/richard11209
Reply by Christian Gollwitzer December 13, 20192019-12-13
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
Reply by Rick C December 12, 20192019-12-12
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
Reply by Eric Jacobsen December 12, 20192019-12-12
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.
Reply by Rick C December 12, 20192019-12-12
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
Reply by Eric Jacobsen December 11, 20192019-12-11
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.
Reply by Rick C December 9, 20192019-12-09
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