forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

pre-implemented FFT routine

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
mrn



Joined: 02 Nov 2005
Posts: 116

PostPosted: Tue Nov 29, 2005 1:10 am    Post subject: pre-implemented FFT routine Reply with quote

yea,FFT is used everywhere, so I thought..
(i know, whenever i start a thread with these words somebody locks it, so....)
.. i thought it would be really smart to have fft precompiled
and offered as a luaplayer routine, in the same way as the battery or control functions are implemented.

fft (real, imag, N, inverse)

this would let us have many-many audio apps,
not to mention, if we would have pre-compiled DCT ...
u know what i am spaking about
h,
Back to top
View user's profile Send private message
KawaGeo



Joined: 27 Aug 2005
Posts: 191
Location: Calif Mountains

PostPosted: Tue Nov 29, 2005 3:29 am    Post subject: Reply with quote

I used FFT for my speech project many years ago. I knew about it. It required a huge amount of calculation to perform a relative large range of sound samples. I don't know if PSP could handle that much amount of calculation, sines and cosines and all. A table of sines and cosines helps to reduce the calculation but enough memory in PSP?
_________________
Geo Massar
Retired Engineer
Back to top
View user's profile Send private message Send e-mail
mrn



Joined: 02 Nov 2005
Posts: 116

PostPosted: Tue Nov 29, 2005 3:47 am    Post subject: Reply with quote

No. Do not worry. for a 256, 512, or even 1024 -point FFT (as normally used in audio processing) you need to store only a piece of a cosine wave in a vector (which is of a length of the FFT-size). So, only some hundreds of Bytes. Then, you just pick up the numbers by downsampling this cosine wave by 2,4,8,16,etc when doing the butterfly multiplications...

Here is a really simple and fast FFT routine written in C.
http://www.jjj.de/fft/int_fft.c

I used it some yrs ago, simple to implement..
Hope, it is not a big problem to put it into our Luaplayer.
mrn
Back to top
View user's profile Send private message
KawaGeo



Joined: 27 Aug 2005
Posts: 191
Location: Calif Mountains

PostPosted: Tue Nov 29, 2005 5:28 am    Post subject: Reply with quote

If it were pre-implemented for Lua Player, it would be handy for speech translation, text-to-speech (easy) for the blind and speech-to-text (not so easy) for the deaf.

I sure hope 32MB RAM is big enough for the task.
_________________
Geo Massar
Retired Engineer
Back to top
View user's profile Send private message Send e-mail
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Tue Nov 29, 2005 8:45 am    Post subject: Reply with quote

Most games and programs won't need it. I think the best idea would be to enhance Lua Player to load self-made PRX modules. A good place for it would be System/Library and write access from Lua Player scripts should be intercepted, to ensure that no script can create and execute unsafe code, which could damage the PSP. Then it is up to the user to manual copy libraries to the Library folder from sources she trust and some useful libs could be included in the standard Lua Player distribution and loaded on demand.
Back to top
View user's profile Send private message
mrn



Joined: 02 Nov 2005
Posts: 116

PostPosted: Tue Nov 29, 2005 7:12 pm    Post subject: Reply with quote

This library idea sounds great, I can provide some good fixed-point /floating-point FFT/DCT routines...
but unfortunately i do not have the time to learn how to create libraries for Luaplayer. Is there sbody willing to do that?

one of the fastest floating-point versions:
http://www.fftw.org/
..and this one was a fixed-point FFT:
http://www.jjj.de/fft/int_fft.c
Back to top
View user's profile Send private message
mrn



Joined: 02 Nov 2005
Posts: 116

PostPosted: Sun Dec 04, 2005 3:16 am    Post subject: Reply with quote

Quote:
Most games and programs won't need it.


What I have been thinkin adout since the beginning is to have a FULL-FEATURED VIRTUAL OS
like OSi or PSPWindows. The reason to have everything inside is that exiting luaplayer
and loading a PdfReader takes lots of time, than imagine searching sthng in a dictianary,
and listening to a song later... impossible without having EVERYTHING INSINDE.

If beside the Lua-games there would be a
- sound recorder,
-Mp3-player,
-video player,
-notepad,
-dictionary,
-calendar
-file browser (like mc or vc .)
-offline browser...

inside this -virtual os- , Lua could become the MOST POPULAR THING for PSP.
But this start-exit-start-exit thing is slow and people get frustrated!
THIS IS WHY I wanted Mic input, FFT, DCT, etcetcetc...

It is our chance to make Lua as it could be before...
(I am already working on a really fast end easy-to-use text editor
and am shure that there would be enough people interested in porting
multimedia apps into Lua. Just check out the num of visitors of this thread.)

if you do not agree with me, pls try to explain why instead of locking this trhread. thats'it..


Last edited by mrn on Sun Dec 04, 2005 9:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
nevyn



Joined: 31 Jul 2005
Posts: 136
Location: Sweden

PostPosted: Sun Dec 04, 2005 11:06 am    Post subject: Reply with quote

Sorry, the following is mostly off-topic. Skip if you're only interesting in fft.

Indeed, the idea of dynamically loading relevant libraries have sprung to my mind several times, I even worked out a great interface for it in my head and then forgot it. (as in interface design and architecture, not code) It allows extensibility without being slow (as in being interpreted). I'm right with you there, Shine.

Mrn, I didn't lock your thread because I disagreed with your ideas, I locked your thread because you were asking questions and bringing forth ideas that had already been debated and dismissed several times all over the forums.

I do believe that most of us have at least played with the idea of a full-fledged application environment within LuaPlayer. I know I have: that's my original vision with Lowser (tho' Lowser's a ridiculously simple (and badly written) app at the moment). Lowser and UIKit are supposed to bring an easy multitasked GUI and event toolkit (if I ever have the time to code it, that is).
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mrn



Joined: 02 Nov 2005
Posts: 116

PostPosted: Sun Dec 04, 2005 9:30 pm    Post subject: Reply with quote

Quote:
(tho' Lowser's a ridiculously simple (and badly written) app at the moment)

Can not we just take the code of PSPWin, replace the icons, sound etc.
with some Crystal-like iconset, more unique sounds, and put everything what we have inside?

The author of PSPWin no more works on it, he already switched to PSPda.

But I more believe in a Lua based Virtual OS, than in a precompiled package like PSPPda,
thanks to its modularity, easy-to-modification, and.. since it is really
interesting to add your own apps to an OS even if you are a beginner .)

The locked forum ... Let's forget it .)
Back to top
View user's profile Send private message
mrn



Joined: 02 Nov 2005
Posts: 116

PostPosted: Mon Jan 16, 2006 9:09 pm    Post subject: Reply with quote

hey, i just implemented fft in lua.
For N= 256 we need 40msec, which means 25 FFTs per second.
Quite slow for real-time audio processing.

Just a note: for speech recognition we need to process ~50 frames per sec,
where at least one FFT per frame (of course, plus a lot of other operations) is required. mrn
Back to top
View user's profile Send private message
mrn



Joined: 02 Nov 2005
Posts: 116

PostPosted: Tue Feb 21, 2006 8:50 pm    Post subject: Reply with quote

Quote:
Most games and programs won't need it.

2D games maybe not. But fast 3D rendering: yess.
Check this out:
http://ieeexplore.ieee.org/xpl/abs_free.jsp?isNumber=29588&prod=JNL&arnumber=1343844&arSt=+1568&ared=+1578&arAuthor=+Weruaga,+L.;++Verdu,+R.;++Morales,+J.&arNumber=1343844&a_id0=1343840&a_id1=1343841&a_id2=1343842&a_id3=1343843&a_id4=1343844&a_i

images in the middle of this page:
http://www.viskom.oeaw.ac.at/~luis/WeruagaPage_files/Research.htm
m.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group