Spectrum analysis (Fourier)

07292015, 12:13 PM
Post: #1




Spectrum analysis (Fourier)
Hello everyone,
let's suppose we have the following signal: f(t)=4+(4/pi)*sin(2*pi*800*t)+(4/(3*pi))*sin(2*pi*2400*t)+(4/(5*pi))*sin(2*pi*4000*t). Ok, this is the resulting waveform (time domain, 4 is the average value): Now the (banal) question is, how can I determine (i.e. to plot) the spectrum (in the frequency domain) of the function on the Prime, something like this below ? Any hint would be helpful. TIA and best, Aries 

07302015, 02:29 AM
(This post was last modified: 07302015 02:30 AM by Brad Barton.)
Post: #2




RE: Spectrum analysis (Fourier)
You're looking for the FFT (Fast Fourier Transform) algorithm. I'd give you more info, but I've loaned out the book I had for it. Google FFT, and you should be able to find what you're looking for.
There are some constraints, such as needing 2^n digitized samples and a couple other things, but it's definitely doable. 

08122015, 11:52 AM
Post: #3




RE: Spectrum analysis (Fourier)
Thanks for your help, Brad, you're right, FFT algorithm is really what I was looking for and I've found it:
http://www.codeproject.com/Articles/9388...algorithm Now I hope to succeed in implementing the DanielsonLanzcos algorithm into the HP Prime. Best, Aries ;) 

08132015, 09:43 PM
(This post was last modified: 08172015 07:16 PM by toshk.)
Post: #4




RE: Spectrum analysis (Fourier)
(i don't have Hp prime to try it.) but works on Emulator.
the App assumes that you place your signal function on F0(X). visualize your signal function (play with scales/auto zoom or whatever you want) for better representation of the signal. Type >>Spect>>Enter. PHP Code: #pragma mode( separator(.,;) integer(h32) ) 

08142015, 08:48 AM
Post: #5




RE: Spectrum analysis (Fourier)
Thanks for your great app, toshk, very very kind of you, it's just what I was looking for and thanks for your great tools on control systems design and analysis (Bode, Nyquist and Nichols charts) too ;)
What about RouthHurwitz and the rootlocus methods ? Are you going to implement those on your future versions ? Happy August holidays, Aries ;) 

08142015, 09:37 AM
Post: #6




RE: Spectrum analysis (Fourier)
The posted code has a syntax error: H1:={'D2','D1','5'}; in the Set() procedure.
I think this is due to the use of H1 as a list variable, which is a global reserved variable of type real. Dale 

08142015, 04:33 PM
(This post was last modified: 08142015 04:36 PM by toshk.)
Post: #7




RE: Spectrum analysis (Fourier)
(08142015 09:37 AM)DrD Wrote: The posted code has a syntax error: H1:={'D2','D1','5'}; in the Set() procedure.Open Statistics 1var Shift>>1 recompile the empty Statistics 1Var. and recompile my code too. 

08142015, 05:06 PM
Post: #8




RE: Spectrum analysis (Fourier)
(08142015 08:48 AM)Aries Wrote: Thanks for your great app, toshk, very very kind of you, it's just what I was looking for and thanks for your great tools on control systems design and analysis (Bode, Nyquist and Nichols charts) too ;)My thoughts: For RootLocus method i think Geometric App is a good candidate. but not animated enough to move points along a path. or move a set of conjugate pairs to its new locations. Also too many rules associated with this method...nevertheless if done on Matlab is doable on temperament Prime.(just less real estate screen). RothHurwitz: i always wanted to implement that on prime...one of these days i will. i tend to use Ackermann's method (space vector) for calculating sensitivity gain K. 

08142015, 05:46 PM
Post: #9




RE: Spectrum analysis (Fourier)
(08142015 04:33 PM)toshk Wrote: Open Statistics 1var Hello, It is always a good idea to fully qualify your app functions  especially for something being shared. Statistics_1Var.H1 would work no matter where the user might be. TW Although I work for HP, the views and opinions I post here are my own. 

08142015, 06:24 PM
(This post was last modified: 08142015 06:42 PM by toshk.)
Post: #10




RE: Spectrum analysis (Fourier)
(08142015 05:46 PM)Tim Wessman Wrote:(08142015 04:33 PM)toshk Wrote: Open Statistics 1var Noted.....and fixed. Thanks. The code was meant for Spectrum(App) based on Statistics_2vars, then to be based on Statistics_1var and finally it striped it done to just app. Any chance to bring back fine(.) or fine dash() or tinnier version of the icons in Statistics_2var App? (real estate price is less attractive with is jumbo icons in some plots sometimes). 

09062015, 12:17 PM
Post: #11




RE: Spectrum analysis (Fourier)
(08142015 05:06 PM)toshk Wrote:(08142015 08:48 AM)Aries Wrote: Thanks for your great app, toshk, very very kind of you, it's just what I was looking for and thanks for your great tools on control systems design and analysis (Bode, Nyquist and Nichols charts) too ;)My thoughts: Thanks toshk, great ideas and I'm looking forward to your updates ;) Best, Aries :) 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)