Randy Yates wrote:> "Manfred" <mmornhin@gmx.net> writes: > >> Hi Randy, >> >>> I have the advantage of seeing the other posters' suggestions and >>> your repsonse, >> For some reason my follow-up ended up posted as a new thread! I don't know >> if I pressed the wrong button, or if it happened for some other reason. So >> now we have two threads with this... >> >>> but how about the following: >>> >>> y[n] = x[n] - 0.61803 * x[n-1] + x[n-2] >>> >>> ? This is an FIR notch filter with a notch right at 20 Hz. >>> The 0.61803 term is 2*cos(0.4*pi). >> But I don't need a notch filter! I need a low pass... Anyway, it's >> interesting! > > Hi Manfred, > > I thought what you needed was to get rid of the 20 Hz interference. Is > this not true? If it is true, then either one will work, no? In fact, > if this is your only goal, the 20 Hz notch should be better.I think he said 420 Hz jitter. Jerry -- Engineering is the art of making what you want from things you can get. ����������������������������������������������������������������������� ** Posted from http://www.teranews.com **
Low pass filter on a PIC
Started by ●October 10, 2008
Reply by ●October 11, 20082008-10-11
Reply by ●October 11, 20082008-10-11
Jerry Avins <jya@ieee.org> writes:> [...] > I think he said 420 Hz jitter.Yeah. I'm not thinking too clearly on this one. What *would* the zero-crossings of A*sin(2*pi*50*t) + B*sin(2*pi*420*t) look like? How are the zero-crossings detected? Does the detection fire off an interrupt to the PIC, in addition to stopping the counter? Wouldn't Manfred possibly get a bunch of interrupts then (i.e., not just an average of 50 samples / second)? -- % Randy Yates % "...the answer lies within your soul %% Fuquay-Varina, NC % 'cause no one knows which side %%% 919-577-9882 % the coin will fall." %%%% <yates@ieee.org> % 'Big Wheels', *Out of the Blue*, ELO http://www.digitalsignallabs.com
Reply by ●October 11, 20082008-10-11
Randy Yates wrote:> Jerry Avins <jya@ieee.org> writes: >> [...] >> I think he said 420 Hz jitter. > > Yeah. I'm not thinking too clearly on this one. > > What *would* the zero-crossings of A*sin(2*pi*50*t) + B*sin(2*pi*420*t) > look like? > > How are the zero-crossings detected? Does the detection fire off an > interrupt to the PIC, in addition to stopping the counter? Wouldn't > Manfred possibly get a bunch of interrupts then (i.e., not just an > average of 50 samples / second)?I don't know how _he_ detects zero crossings. I have done it with a hardware comparator* tied to the trigger of a catch register. The catch register latches the contents of a continuously running counter. The trigger (if I remember 68HC1x correctly) not only transfers the count, but also can set an interrupt. There are several independently clocked registers, so by clocking one with the positive-going comparator edge and the other with the negative, you have independent whole-cycle measurements twice per cycle. The interrupt routine subtracts the register contents from the stored previous reading. Magically, counter wraparound washes out (but of course, Mr. Fixedpoint, you know that). *Because the counter never stops, there is no cumulative error.* That's fraction saving of a different kind. :-) Jerry ___________________________ * The cheap way is just a diode tied to the positive power-supply rail in series with a resistor tied to the AC of 12V or more. The junction of the resister and diode switches pretty fast between logic 0 and 1. Still, for noise immunity, I prefer a little hysteresis. -- Engineering is the art of making what you want from things you can get. ����������������������������������������������������������������������� ** Posted from http://www.teranews.com **






