(Comp.sys.handhelds) Item: 3762 by _kevin at hpcvbbs.cv.hp.com Author: [Kevin Jessup] Subj: HP48SX DIGITAL FILTER DEMO Date: Wed Jul 24 1991 Hello again! I recently got my hands on a copy of MathCAD. I was playing around with its FFTs and DSP filtering routines when I decided that after paying 275 bucks for my 48, it had damn well better be able to do the same thing. :-) I immediately wasted 3 hours coding up the routines you'll see below. What a time-saver the 48SX is!! The routines do nothing really usefull. It's just a demo of sorts. Here is the sequence when you press the DEMO key... 1.) DEMO will use a predefined function (sin(x) is used, but you can change it) to generate an array of x and y coordinates using the summation function. 2.) A scatter plot of the data is drawn. 3.) Noise is added to the data. 4.) The scatter plot is redrawn. 5.) The data is filtered. 6.) The scatter plot is redrawn. 7.) Repeat steps 5 and 6 four more times. 8.) The display is frozen. Press ON to quit. 9.) If you want to filter the same data a few more times, just press FDMO till you are satisfied. Now just one damn minute here before all you DSP gurus grab your flame throwers! :-) MY AREA OF EXPERTISE IS NOT DSP! My knowledge of DSP is somewhere between none and very little and my knowledge of analog electronics does not go beyond the typical undergraduate stuff. I was just playing around. Now that you know that, feel free to modify the main filter algorithm (called SMOOTH) to use whatever method works best and/or fastest for you. All I am doing is providing a bit of a front end and user interface for demo purposes. I'm not even sure if the 48 could ever be put to use where the sample rate is so high and the data quality so poor that such algorithms are needed. Let's just say that this is for educational purposes only. The best thing that can come out of this posting is that those who really know how to do this stuff will post some of their routines! Perhaps such routines have already been posted. If so, sorry about the wasted bandwidth. One last item of interest. If I run the BUILD routine seperately in a directory just off of HOME (the path is {HOME DSP}), the BUILD routine takes about 130 seconds. If I copy the entire directory down a level (the path is {HOME TEMP DSP}) it takes about 50 seconds. This is repeatable. Yet the SMOOTH algorithm takes an identical amount of time in both directories. What is going on here??? Happy filtering! Kevin Jessup Home: (414)355-9752 Office: (414)362-2020 BBS: (414)362-2020 after 6PM CST