summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/src
diff options
context:
space:
mode:
authorMarcel Lauwerijssen <paranoya@morphcore.com>2004-12-22 14:42:08 (GMT)
committerMarcel Lauwerijssen <paranoya@morphcore.com>2004-12-22 14:42:08 (GMT)
commit1de017e19015570f0ae8e35612e6aae382ce789c (patch)
treec213c63d3c64240959f3ad1289958a1e9bd2ec4d /Graphic_Equalizer/src
parentf08be707d62975e6f6dd35720bf0867990dde730 (diff)
downloadTASS-1de017e19015570f0ae8e35612e6aae382ce789c.zip
TASS-1de017e19015570f0ae8e35612e6aae382ce789c.tar.gz
TASS-1de017e19015570f0ae8e35612e6aae382ce789c.tar.bz2
Modified comments
Diffstat (limited to 'Graphic_Equalizer/src')
-rw-r--r--Graphic_Equalizer/src/fft.hcc2
-rw-r--r--Graphic_Equalizer/src/runfft.hcc15
2 files changed, 15 insertions, 2 deletions
diff --git a/Graphic_Equalizer/src/fft.hcc b/Graphic_Equalizer/src/fft.hcc
index 1fda3b0..d7473b5 100644
--- a/Graphic_Equalizer/src/fft.hcc
+++ b/Graphic_Equalizer/src/fft.hcc
@@ -379,6 +379,8 @@ void perform_ifft(signed 16 *modified_audio, unsigned 6 *ifft_info)
modified_audio[k] = (p<-16);
#endif
//Fill the array for displaying the waveform, only the 6 MSB are needed.
+ //Because the display routine needs unsigned values a cast is done here, this should be fixed
+ //in such a way a cast is not necessary anymore.
ifft_info[k] = (unsigned 6)(32+(p[17:12]));
k++;
}
diff --git a/Graphic_Equalizer/src/runfft.hcc b/Graphic_Equalizer/src/runfft.hcc
index 55d4b05..7098070 100644
--- a/Graphic_Equalizer/src/runfft.hcc
+++ b/Graphic_Equalizer/src/runfft.hcc
@@ -105,6 +105,11 @@ macro proc audio_main(audiodata, AUDIOIN, AUDIOOUT)
FFT_Sync=0;
par
{
+ /*
+ * FFT loop, waits until 64 samples are read from the audio input
+ * before switching the pointers needed for double and quadruple buffering, after that
+ * sequentially calling the perform_fft, equalize_audio and perform_ifft functions.
+ */
for(;;)
{
if (FFT_Sync) //if 64 samples are read from ADC...
@@ -140,7 +145,10 @@ par
else
delay;
}
-
+ /*
+ * Sampling loop, fills the audio input and output arrays and uses FFT_Sync
+ * to notify the FFT when 64 samples are read from the audio input.
+ */
for(sample_count=0;;)//store the samples in the inputbuffer
{
if (!FFT_Sync)
@@ -151,7 +159,7 @@ par
{
PalAudioInRead(AUDIOIN, &LeftNew, &RightNew);
#if HARDWARE_MULTIPLY
- audioptr_in1[sample_count] = LeftNew;//drop 2 LSB's
+ audioptr_in1[sample_count] = LeftNew;
#else
audioptr_in1[sample_count] = (LeftNew\\2);//drop 2 LSB's
#endif
@@ -172,6 +180,9 @@ par
delay;
}
}
+ /*
+ * Audio output loop, writes the modified audio samples to the audio output.
+ */
for(;;)
{
PalAudioOutWrite(AUDIOOUT,(signed OW)(Output_sample @ 0),(signed OW)(Output_sample @ 0));