summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/src/runfft.hcc
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2004-12-09 14:00:26 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2004-12-09 14:00:26 (GMT)
commitb0ae032ae5712e38471c9347af289f3e50b0a08a (patch)
tree5f98113107975ddcc484cffb27625e09d015f504 /Graphic_Equalizer/src/runfft.hcc
parent593d5fded11b8723ce27883e06865ab205c6f008 (diff)
downloadTASS-b0ae032ae5712e38471c9347af289f3e50b0a08a.zip
TASS-b0ae032ae5712e38471c9347af289f3e50b0a08a.tar.gz
TASS-b0ae032ae5712e38471c9347af289f3e50b0a08a.tar.bz2
Added defines makeing it possible to split the application in various parts namely:
Loader (loads data from the smart media into ram) Equalizer (The 'normal' known application) Visualization (The graphical visualization)
Diffstat (limited to 'Graphic_Equalizer/src/runfft.hcc')
-rw-r--r--Graphic_Equalizer/src/runfft.hcc182
1 files changed, 0 insertions, 182 deletions
diff --git a/Graphic_Equalizer/src/runfft.hcc b/Graphic_Equalizer/src/runfft.hcc
deleted file mode 100644
index 55d4b05..0000000
--- a/Graphic_Equalizer/src/runfft.hcc
+++ /dev/null
@@ -1,182 +0,0 @@
-/*! \file runfft.hcc
- *
- * \section generic This module will handle the audio I/O. It will ensure the
- * audiosamples are correctly buffered and fed correctly to the FFT.\n
- * This module will also handle the output of the modified audio samples.
- *
- * \section project Project information.
- * Project Graphic Equalizer\n
- * \author M. Lauwerijssen
- * \date 20041110
- * \version 0.1
- *
- * \section copyright Copyright
- * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
- *
- * \section history Change history
- * 20041110: M. Lauwerijssen\n Initial version
- *
- ********************************************************************/
-#include <stdlib.hch>
-#include "pal_master.hch"
-
-#include "configuration.hch"
-#if USE_RUNFFT
-#include "audio.hch"
-#include "fft.hch"
-
-#if HAVE_DEBUG
- #include "debug.hch"
-#endif
-
-/*
- * Forward declarations
- */
-static macro expr ClockRate = PAL_ACTUAL_CLOCK_RATE;
-#if HARDWARE_MULTIPLY
-//input buffer
-ram signed 18 audio_buffer_in[256] with { block = "BlockRAM"};
-//output buffer
-ram signed 18 audio_buffer_out[128] with { block = "BlockRAM"};
-#else
-//input buffer
-ram signed 16 audio_buffer_in[256] with { block = "BlockRAM"};
-//output buffer
-ram signed 16 audio_buffer_out[128] with { block = "BlockRAM"};
-#endif
-//EQ settings for the FFT
-ram unsigned 4 EQ_info[128] with { block = "BlockRAM"};
-//EQ settings received from the display
-
-
-#if HARDWARE_MULTIPLY
-signed 18 *audioptr_in1,*audioptr_in2,*audioptr_in3,*audioptr_in4;
-
-signed 18 *audioptr_out1,*audioptr_out2;
-
-unsigned 6 *displayptr1,*displayptr2,*displayptr3,*displayptr4;
-#else
-signed 16 *audioptr_in1,*audioptr_in2,*audioptr_in3,*audioptr_in4;
-
-signed 16 *audioptr_out1,*audioptr_out2;
-
-unsigned 6 *displayptr1,*displayptr2,*displayptr3,*displayptr4;
-#endif
-
-/*! \fn macro proc audio_main(AUDIOIN, AUDIOOUT);
- * \brief Audio I/O component main.
- *
- * \param audiodata Pointer to audiodata struct
- * \param AUDIOIN Handle to audio-input
- * \param AUDIOOUT Handle to audio-output
- *
- * \return Never Returns.
- * \retval void
- */
-macro proc audio_main(audiodata, AUDIOIN, AUDIOOUT)
-{
- signed 18 sample;
- unsigned 6 sample_count;
- unsigned 8 i,cycle;
- unsigned 4 eqinfo;
-
- unsigned 1 FFT_Sync, first;
- macro expr OW = PalAudioOutGetMaxDataWidthCT ();
- macro expr IW = PalAudioInGetMaxDataWidthCT ();
- signed LeftNew, RightNew;
- signed Output_sample;
-
- ram unsigned 6 input[64];
-
- //pointers for double and quadruple buffering:
- audioptr_in1 = &audio_buffer_in[0];
- audioptr_in2 = &audio_buffer_in[64];
- audioptr_in3 = &audio_buffer_in[128];
- audioptr_in4 = &audio_buffer_in[192];
-
- audioptr_out1 = &audio_buffer_out[0];
- audioptr_out2 = &audio_buffer_out[64];
-
- displayptr1 = &audiodata.ifft_info.write[0];
- displayptr2 = &audiodata.ifft_info.write[64];
- displayptr3 = &audiodata.ifft_info.write[128];
- displayptr4 = &audiodata.ifft_info.write[192];
-
- FFT_Sync=0;
-par
-{
- for(;;)
- {
- if (FFT_Sync) //if 64 samples are read from ADC...
- {
- par
- {
- // switch pointers
- audioptr_in1 = audioptr_in2;
- audioptr_in2 = audioptr_in3;
- audioptr_in3 = audioptr_in4;
- audioptr_in4 = audioptr_in1;
-
- audioptr_out1 = audioptr_out2;
- audioptr_out2 = audioptr_out1;
-
- displayptr1=displayptr2;
- displayptr2=displayptr3;
- displayptr3=displayptr4;
- displayptr4=displayptr1;
-
- FFT_Sync = 0;
- }
-
- // FFT calculation
- perform_fft(audioptr_in1);
-
-#if PERFORM_FFT_CALCULATION
- equalize_audio(&audiodata);
-#endif
- // inverse FFT calculation
- perform_ifft(audioptr_out1,displayptr1);
- }
- else
- delay;
- }
-
- for(sample_count=0;;)//store the samples in the inputbuffer
- {
- if (!FFT_Sync)
- {
- par
- {
- seq
- {
- PalAudioInRead(AUDIOIN, &LeftNew, &RightNew);
-#if HARDWARE_MULTIPLY
- audioptr_in1[sample_count] = LeftNew;//drop 2 LSB's
-#else
- audioptr_in1[sample_count] = (LeftNew\\2);//drop 2 LSB's
-#endif
- sample_count++;
- if (!sample_count)
- {
- FFT_Sync = 1;
- }
- }
- seq
- {
- Output_sample = audioptr_out2[sample_count];
- }
- }
- }
- else
- {
- delay;
- }
- }
- for(;;)
- {
- PalAudioOutWrite(AUDIOOUT,(signed OW)(Output_sample @ 0),(signed OW)(Output_sample @ 0));
- }
-}//end par
-}// end function
-#endif
-