 |
|
 |
| Parallax Forums > Public Forums > Propeller Chip > Fast Hartley Transform | Forum Quick Jump
|
|  ngl Registered Member
        Date Joined Sep 2006 Total Posts : 17 | Posted 10/29/2009 5:22 PM (GMT -8) |   | | There has been some discussion of the Fast Fourier Transform implementation on the propeller in another thread on this forum. One approach was detailed in the Propeller Wiki. I would suggest that a more practical approach to fft implementation is the Fast Hartley Transform (FHT), which works with real numbers, therefore running faster than the FFT. Furthermore, the FHT is its own inverse function and the FFT can be calculated from the FHT. Ullmann (sepwww.stanford.edu/theses/sep38/38_29_abs ) has described a FHT algorithm (expressed in Ratfor) which is easily translated into Spin.
The attached spin file is a first implementation of the 1-dimensional HFT, which also includes methods for calculating the Power Spectrum and the FFT. ViewPort was used to debug the program and view the results. Things to do include providing a graphical data display, converting the subroutines (eg, butterfly) to pasm, timing studies with larger data sets, and implementing the 2-dimensional FHT.
Comments and suggestions are welcome.
Nick
Corrected spin file and url. Post Edited (ngl) : 10/31/2009 4:49:28 AM GMT File Attachment : FHT.spin 5KB (application/octet-stream) This file has been downloaded 17 time(s). | | Back to Top | | |
 |  Kye Kwabena Agyeman

       Date Joined Feb 2008 Total Posts : 619 | Posted 10/29/2009 8:05 PM (GMT -8) |   | | | |
  |  hover1 I have 3 Propellers

       Date Joined Sep 2007 Total Posts : 371 | Posted 10/30/2009 4:14 AM (GMT -8) |   | | | |
 |  Jamesx Registered Member
        Date Joined Aug 2005 Total Posts : 123 | Posted 10/30/2009 5:17 AM (GMT -8) |   | Thanks, Nick.
I am very interested in this work. My problem is that I don't know much about FFT or FHT, but having this code and references gives me somewhere to start. I am looking forward to your successes at getting it into ASM, as well as tests of timing.
Jim C. | | Back to Top | | |
  |  ngl Registered Member
        Date Joined Sep 2006 Total Posts : 17 | Posted 10/30/2009 8:43 PM (GMT -8) |   | David: I find Bracewell very useful - I am still using it.
Hanno: ViewPort allowed me to quickly find programming errors. A great product. I will have to look at the speech recognition challange. I would like to use the xy widget in ViewPort to display the FHT results. Any hints on how to do this?
There is a sign error in the FFT method. The last statement should be Im[k] := (-fx[k] + fx[len-k+2])/2
I have converted the program to a true object which also includes convolution & correlation methods. I will post as soon as I have a working demo. | | Back to Top | | |
  |  BR Omelette du fromage!

       Date Joined Dec 2008 Total Posts : 6 | Posted 10/31/2009 8:12 AM (GMT -8) |   | Nick,
This is very cool. I don't have a copy of viewport (yet), so I made a version that uses the Parallax Serial Terminal. I set up the output so it can be directly imported into PLX_DAQ for easy plot/visualization. I also added sin, cos, step, and impulse functions to the examples you had so I could see the output with various waveform inputs.
I included a copy of my PLX_DAQ excel file in the archive...for anybody who'd rather get a fresh copy of PLX_DAQ, it is available here: http://www.parallax.com/Portals/0/Downloads/sw/plx_daq_install.zip
The output from the various input waveforms isn't exactly what I was expecting...but that may be as much due to my ignorance of the subject area as anything else. Between you, Jay, and lonesock, and others, it's been a veritable frequency transform cornucopia here in the forums lately.
Looking forward to your next update.
BR
EDIT: updated archive attachment: -Added a random (white) noise function, pulse function -Added a simple measurement of #clock cycles required to complete H-xform -Added magnitude and phase plots in excel PLX_DAQ worksheet -Misc. tweaksPost Edited (BR) : 11/2/2009 3:19:54 AM GMT
File Attachment : FHT - Archive [Date 2009.11.01 Time 22.15].zip 84KB (application/x-zip-compressed)This file has been downloaded 5 time(s). | | Back to Top | | |
 |  ngl Registered Member
        Date Joined Sep 2006 Total Posts : 17 | Posted 11/2/2009 5:22 PM (GMT -8) |   | | Attached find a 2nd version of the FHT project reformatted as a basic FHT object and a demo program to exercise the FHT object.
BR: Thanks for your interest and additions to FHT. I have incorporated them, with modifications to accomodate the new FHT object, in the attached demo program. That is, your earlier additions. I look forward to making further additions to the demo program.
I have replaced attached programs with new versions containg BR's latest additions.
Nick Post Edited (ngl) : 11/3/2009 2:07:22 AM GMT File Attachment : FHT_20091101.spin 4KB (application/octet-stream) This file has been downloaded 15 time(s). File Attachment : FHT_Demo_1.spin 15KB (application/octet-stream) This file has been downloaded 11 time(s). | | Back to Top | | |
      | Forum Information | Currently it is Friday, November 20, 2009 11:06 PM (GMT -8) There are a total of 393,737 posts in 55,521 threads. In the last 3 days there were 82 new threads and 701 reply posts. View Active Threads
| | Who's Online | This forum has 17687 registered members. Please welcome our newest member, mark09. 49 Guest(s), 1 Registered Member(s) are currently online. Details OakGraphics |
Forum powered by dotNetBB v2.42EC SP2.02 dotNetBB © 2000-2009 |
|
|