Hello Craig, That means that you have a maximum of 500 us to do all of your multiply and accumulates needed for a filter. If fourth order (four fixed point multiplies) and 32 bit intermediate results, that seems like a lot to ask a Pic to do, even at 20 MHz. At 20 MHz you are going to get 2500 instruction cycles in your sample time, not counting double cycle jumps. Since the standard 16 x 16 = 32 multiply is 233 cycles, you do have some time for other program tasks. I would guess that you need some sort of speed up, like a straight line multiply that is pre-done for the factors involved, presuming the filter coefficients are going to be the same for your application. Sounds doable but real tight, but I'll bet you can find a filter type and sample rate that will let you perform some sort of very quick multiply (factor of 2, etc.). Other factors, of course include the steepness of the filter and the sensitivity to amplification before the start of the filter frequency. I have found that many types of filters, (Chebychev, etc.) give a gain before the filter starts rolling off. If your application is sensitive to this you may want to look at elliptical or some other type. Tom On Friday, March 06, 1998 10:55 AM, Craig Webb [SMTP:lucid@MAGNET.CA] wrote: > Tom, > > Thanks for the help. I'm running at about 2000 samps/sec (though I'd like to > run 8 channels!). We'll see how it goes. Some good suggestions though. How > many bytes would you use to keep good resolution at 13 bits? The person I'm > working with who has already written some LPF code said we need four byte to > keep precision. This seems a bit high to me. > > Craig > > At 05:39 PM 3/5/98 -0500, you wrote: > >Aside from the obvious of an accumulator being a low pass filter, we > >normally hard code the time consuming parts of the digital filters, > >presuming that your filter coefficients are not going to change. We either > >pre-do the multiply of factors based on a trig function times a constant or > >tweak the multiply. The former is done by doing the stage multiplication > >off line and interpolating results of table look-ups. The latter is done by > >skipping the bit tests on the multiplicand and straight-line coding the > >shifts. > > > >Obviously, the time per cycle of multiply and accumulates, as with > >everything in DSP, is dependent upon your sample frequency. For mains > >power, ya got a lotta time. For voice, you'd better be doing some real > >tricky stuff in a PIC if you're doing the number of orders and resolution > >that you are looking at. We have had great luck by varying the sample > >frequency and type of filter until you get to coefficients that either > >disappear or are very easy multiplies. You can do this type of iteration > >easily with filter design packages, although normally the output is in > >terms of C code or asm for the popular DSP's. > > > >Tom > > > >On Thursday, March 05, 1998 2:22 PM, Craig Webb [SMTP:lucid@MAGNET.CA] > >wrote: > >> Thanks everyone for the WWVB (Boulder or Fort Collins?) info on the 60kHz > >> time standard. > >> > >> I am also interested in finding out if anyone has done digital low pass > >> filtering. I need fast code that can do about 4th order (and ideally up > >to > >> 6th order) filtering on 13-bit signals. Does anyone have this or know > >where > >> I can find it? > >> > >> Thanks. > >> > >> C. Webb > > > >