diff options
author | Oliver Schinagl <oliver@schinagl.nl> | 2004-11-15 14:18:46 (GMT) |
---|---|---|
committer | Oliver Schinagl <oliver@schinagl.nl> | 2004-11-15 14:18:46 (GMT) |
commit | 1db17be5a3ba68ffb5b9b23af6ac52a1b29e89ed (patch) | |
tree | 85c6eeaa6055b5ff9ed8b4a182eeed61e00a6961 | |
parent | 7613a018158007a51d9b6843b97a7a0d51a9440f (diff) | |
download | TASS-1db17be5a3ba68ffb5b9b23af6ac52a1b29e89ed.zip TASS-1db17be5a3ba68ffb5b9b23af6ac52a1b29e89ed.tar.gz TASS-1db17be5a3ba68ffb5b9b23af6ac52a1b29e89ed.tar.bz2 |
-rw-r--r-- | FFT_Test/FFT_Test.hp | 14 | ||||
-rw-r--r-- | FFT_Test/debug.hcc | 92 | ||||
-rw-r--r-- | FFT_Test/debug.hch | 51 | ||||
-rw-r--r-- | FFT_Test/fft_hardware.hcc | 7 | ||||
-rw-r--r-- | FFT_Test/runfft.hcc | 17 |
5 files changed, 18 insertions, 163 deletions
diff --git a/FFT_Test/FFT_Test.hp b/FFT_Test/FFT_Test.hp index 2612112..e00745e 100644 --- a/FFT_Test/FFT_Test.hp +++ b/FFT_Test/FFT_Test.hp @@ -253,7 +253,7 @@ setting RC200E "include:R:\\c2hardw\\Program Files\\celoxica\\pdk\\hardware\\inc setting RC200E "include:R:\\c2hardw\\Program Files\\celoxica\\pdk\\hardware\\" false
setting RC200E include:..\\..\\..\\include false
setting RC200E include:include false
-setting RC200E include:..\\Support_Libs\\debug false
+setting RC200E include:..\\Support_Libs\\debug true
setting RC200E include:C:\\Project_CVS\\Support_Libs\\debug false
setting RC200E "lib:C:\\Program Files\\Celoxica\\PDK\\Hardware\\Lib\\stdlib.hcl" false
command RC200E "cd RC200"
@@ -262,12 +262,6 @@ output RC200E RC200\\FFT_test.bit document config.hch {
type hch
}
-document debug.hcc {
- type hcc
-}
-document debug.hch {
- type hch
-}
document fft.hch {
type hch
}
@@ -289,3 +283,9 @@ document runfft.hch { document weights256.hch {
type hch
}
+document ..\\support_libs\\debug\\debug.hcc {
+ type hcc
+}
+document ..\\support_libs\\debug\\debug.hch {
+ type hch
+}
diff --git a/FFT_Test/debug.hcc b/FFT_Test/debug.hcc deleted file mode 100644 index 44736e3..0000000 --- a/FFT_Test/debug.hcc +++ /dev/null @@ -1,92 +0,0 @@ -#include <stdlib.hch>
-
-#include "pal_master.hch"
-
-#include "debug.hch"
-
-void print_hex_value(unsigned value)
-{
- unsigned 8 ch;
- unsigned 4 i;
- unsigned 32 tempvalue;
-
- tempvalue = 0 @ value;
-
- for(i = 0;i < 8;i++)
- {
- ch = 0 @ (tempvalue\\28);
- tempvalue <<= 4;
- ch += (ch > 9) ? 0x37 : 0x30;
- PalDataPortWrite(PalRS232PortCT(0), ch);
- }
-}
-
-
-void print_signed_hex_value(signed value, unsigned 6 size)
-{
- unsigned 8 ch;
- unsigned 4 i;
- signed 32 stempvalue;
- unsigned 32 utempvalue;
- unsigned 6 bit;
- unsigned 1 inverse;
-
- if(value & (1<<size))
- stempvalue = adjs(value,32);
- else
- stempvalue = 0@value;
- utempvalue = 0;
-
- if(stempvalue<0)
- {
- for(bit = 0;bit < size; bit++)
- {
- if (stempvalue & (1<<bit))
- {
- utempvalue = 1<<bit;
- utempvalue += (unsigned)~(stempvalue >> bit);
- bit = size;
- }
- }
- PalDataPortWrite(PalRS232PortCT(0), '-');
- }
- else
- {
- utempvalue = (unsigned)stempvalue;
- }
-
-/* if(stempvalue[size]==1)
- {
- PalDataPortWrite(PalRS232PortCT(0), '-');
- mask = ~(0 @ (1<<size));
- utempvalue = ((unsigned)stempvalue) & mask;
- }
- else
- {
- utempvalue = (unsigned)stempvalue;
- }
-*/
- for(i = 0;i < 8;i++)
- {
- ch = 0 @ (utempvalue\\28);
- utempvalue <<= 4;
- ch += (ch > 9) ? 0x37 : 0x30;
- PalDataPortWrite(PalRS232PortCT(0), ch);
- }
-}
-
-void print_string(unsigned char *s) {
- unsigned 10 i;
- i = 0;
- for(i = 0;'\0' != s[i];i++)
- {
- PalDataPortWrite(PalRS232PortCT(0), s[i]);
- }
-
-}
-
-void print_eol(void)
-{
- PalDataPortWrite(PalRS232PortCT(0), 0x0A);
-// PalDataPortWrite(PalRS232PortCT(0), 0x0D);
-}
\ No newline at end of file diff --git a/FFT_Test/debug.hch b/FFT_Test/debug.hch deleted file mode 100644 index 9a661c9..0000000 --- a/FFT_Test/debug.hch +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************
- *
- * print_hex_value (unsigned value)
- *
- * Arguments: (typical)
- * value: The integer which will be printed
- *
- * Description: (typical)
- * This function will print the integer through the RS232 interface in a
- * 32-bit hexadecimal representation.
- * Pre: Value must be smaller or equal to 32-bits.
- * Post: A hex representation of value is printed.
- *
- ****************************************************************************/
-void print_hex_value(unsigned value);
-
-
-/****************************************************************************
- *
- * print_hex_value (signed value, )
- *
- * Arguments: (typical)
- * value: The integer which will be printed
- * size: The width of the integer to be printed
- * Description: (typical)
- * This function will print the integer through the RS232 interface in a
- * 32-bit hexadecimal representation.
- * Pre: Value must be smaller or equal to 32-bits, and the value must be
- signed.
- * Post: A hex representation of value is printed.
- *
- ****************************************************************************/
-void print_signed_hex_value(signed value, unsigned 6 size);
-
-/****************************************************************************
- *
- * print_string (unsigned char *s)
- *
- * Arguments: (typical)
- * s: Pointer to an array containg a string top print.
- *
- * Description: (typical)
- * This function will print a string through the RS232 interface.
- * Pre: The array must be /0 terminated.
- * Post: The string is printed as is.
- *
- ****************************************************************************/
-void print_string(unsigned char *s);
-
-
-void print_eol(void);
\ No newline at end of file diff --git a/FFT_Test/fft_hardware.hcc b/FFT_Test/fft_hardware.hcc index 9e1b6ba..5c209e8 100644 --- a/FFT_Test/fft_hardware.hcc +++ b/FFT_Test/fft_hardware.hcc @@ -334,13 +334,12 @@ void perform_ifft(signed 16 *modified_audio/*, unsigned 6 *ifft_info*/) /********************************************************************/
void equalize_audio(unsigned 4 *eq_level, unsigned 7 *fft_info)
{
-#if 1
#if HARDWARE_MULTIPLY
signed 18 p,q;
#else
signed 24 p,q;
#endif
- signed 16 a;
+ signed 18 a;
unsigned 8 i, mirror_i, bit, m, n;
unsigned 7 old_value;
unsigned 9 tmp;
@@ -363,10 +362,10 @@ void equalize_audio(unsigned 4 *eq_level, unsigned 7 *fft_info) // imaginary.rwrite[0] = 0; // remove DC component
- for(i=0;i<=NUMBER_OF_FREQUENCIES;i++)
+ for(i=0;i!=NUMBER_OF_FREQUENCIES;i++)
{
// set multiplication factor (0..64) for current frequency bar, The first frequency band must be equalized at 100% (63) since there is no DC-component taken into account.
- a = (i==0) : 63 ? adjs(eq_settings[eq_level[i<-7]],18);
+ a = (i==0) ? 63 : adjs(eq_settings[eq_level[i<-7]],18);
// multiply frequency with this factor and divide by 64 (drop 6 LSB's)
diff --git a/FFT_Test/runfft.hcc b/FFT_Test/runfft.hcc index 20aee06..27306a7 100644 --- a/FFT_Test/runfft.hcc +++ b/FFT_Test/runfft.hcc @@ -70,9 +70,9 @@ signed 16 *audioptr_in1,*audioptr_in2,*audioptr_in3,*audioptr_in4; signed 16 *audioptr_out1,*audioptr_out2;
signed 16 *audioptr_temp;
#endif
-unsigned 3 active_preset;
+unsigned 10 active_preset;
-shared expr preset_address = (0@(active_preset-1))<<7;
+shared expr preset_address = (active_preset << 7);
void LoadPresets()
{
@@ -113,7 +113,7 @@ macro proc RunFFT (AudioIn, AudioOut) signed Output_sample;
ram unsigned 6 input[64];
- active_preset = 3;
+ active_preset = 2;
//pointers for double and quadruple buffering:
audioptr_in1=&audio_buffer_in[0];
@@ -153,17 +153,16 @@ par #if 1
for(i=0;i<NUMBER_OF_FREQUENCIES;i++)
{
- eqinfo = EQ_level.read[preset_address+(0@i)];
+ eqinfo = EQ_level.read[preset_address+(0 @ i)];
EQ_info[i<-7] = eqinfo;
if(first)
{
- print_string("eqinfo: "):
- print_hex_value(eqinfo);
- print_eol();
- first = 0;
+ print_string("eqinfo: ");
+ print_hex_value(0 @ eqinfo);
+ print_eol();
}
}
-
+ first = 0;
// set volume of each individual frequency bar (equalizer)
|