0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 1 /************* Revision Controle System Header *************
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 2 * GSM Layer 1 software
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 3 * L1AUDIO_CUST.H
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 4 *
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 5 * Filename l1audio_cust.h
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 6 * Copyright 2003 (C) Texas Instruments
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 7 *
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 8 ************* Revision Controle System Header *************/
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 9
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 10 #if (AUDIO_TASK == 1)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 11
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 12 #if (OP_RIV_AUDIO == 0)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 13 extern void vocoder_mute_dl (BOOL mute);
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 14 extern void vocoder_mute_ul (BOOL mute);
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 15 #endif
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 16
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 17 #if (MELODY_E1)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 18 //----------------------------------------
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 19 // Melody format E1 constant.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 20 //----------------------------------------
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 21
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 22 // Number of oscillators (fixed value)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 23 #define SC_NUMBER_OSCILLATOR 8
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 24
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 25 // Define the unit of the downloading time (fixed value)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 26 #define SC_MELO_DOWNLOAD_TIME_UNIT 4 // unit = 20ms
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 27
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 28 #endif // MELODY_E1
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 29
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 30 #if (VOICE_MEMO) || (SPEECH_RECO)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 31 //----------------------------------------
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 32 // Voice memo constant.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 33 //----------------------------------------
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 34
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 35 // Word to indicate the end of the speech data (fixed value).
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 36 #define SC_VM_END_MASK 0xFBFF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 37
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 38 #endif // VOICE_MEMO || SPEECH_RECO
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 39
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 40 #if (L1_VOICE_MEMO_AMR)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 41 //----------------------------------------
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 42 // Voice memo amr constant.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 43 //----------------------------------------
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 44
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 45 // Word to indicate the end of the speech data (fixed value).
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 46 #define SC_VM_AMR_END_MASK_SIZE 1
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 47 #define SC_VM_AMR_END_MASK 0xFF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 48
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 49 #endif // L1_VOICE_MEMO_AMR
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 50
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 51 #if (SPEECH_RECO)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 52 //----------------------------------------
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 53 // Speech recognition constant.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 54 //----------------------------------------
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 55
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 56 // Error ID (fixed values)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 57 #define SC_NO_ERROR 0 // No error
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 58 #define SC_BAD_ACQUISITION 1 // Bad acquisition of the word. The word is too long or too short
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 59 #define SC_TIME_OUT 2 // The DSP task to acquire the word takes to much time
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 60 #define SC_BAD_UPDATE 3 // Bad update of the model. The model from the database is too different
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 61 // than the model built during the acquisition.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 62 #define SC_BAD_RECOGNITION 4 // This word is out of vocabulary or the best words are too close
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 63 #define SC_CTO_WORD 5 // A word generated by the CTO algorithm is the best word.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 64 #define SC_CHECK_ERROR 6 // The best word isn't the word to update.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 65
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 66 // Time out (fixed values)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 67 #define SC_SR_AQUISITION_TIME_OUT 867 // acquisition time out in fn unit (3s).
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 68 #define SC_SR_UPDATE_TIME_OUT 500 // update time out in fn unit.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 69 #define SC_SR_PROCESSING_TIME_OUT 500 // processing time out in fn unit.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 70
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 71
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 72 // CTO algorithm parameters (tuning value)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 73 #define SC_SR_MAX_WORDS_FOR_CTO 4 // Threshold to decide when the CTO algorithm is needed:
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 74 // if the number of model is less 0r equal to this value, the CTO algo. is enabled.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 75
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 76 // model constant (fixed values)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 77 #define SC_SR_MODEL_FRAME_SIZE 16 // size of the model parameters per audio frames (20 ms).
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 78 #define SC_SR_MODEL_API_SIZE 1041 // size of the model corrsponding to the longest possible word (1,3 second):
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 79 // 16 words frames* 1,3s/20ms + 1 = 1041
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 80 // the header word of the model gives the size of the model in model frame unit.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 81 #define SC_SR_MMI_DB_MODEL_SIZE SC_SR_MODEL_API_SIZE // maximum size of the model in the MMI database.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 82
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 83 // speech constant (fixed values)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 84 #define SC_SR_SPEECH_FRAME_SIZE 20 // size of the speech samples per audio frams (20ms)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 85
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 86 #define SC_SR_SPEECH_WORD_SIZE 65 // maximum size in speech frame size unit of the word to acquire
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 87 #define SC_SR_SPEECH_WORD_BEGIN_VAD_LATENCY 35 // time in speech frame size unit to detect that the word begins
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 88 #define SC_SR_SPEECH_WORD_END_VAD_LATENCY 35 // time in speech frame size unit to detect that the word is finished
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 89 #define SC_SR_SPEECH_WORD_BEGIN_MARGIN 5 // time in speech frame size unit to add a beginning margin of the word
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 90 #define SC_SR_SPEECH_WORD_END_MARGIN 5 // time in speech frame size unit to add a end margin of the word
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 91 #define SC_SR_SPEECH_ENDING_DONE_MARGING 20 // time in speech frame size unit to have the word done status after the word ending status.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 92
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 93 #define SC_SR_MMI_2_L1_SPEECH_SIZE (SC_SR_SPEECH_WORD_BEGIN_MARGIN + SC_SR_SPEECH_WORD_SIZE + SC_SR_SPEECH_WORD_END_VAD_LATENCY + SC_SR_SPEECH_ENDING_DONE_MARGING) * SC_SR_SPEECH_FRAME_SIZE
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 94 // size of the speech buffer allocated by MMI to acquire the speech.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 95 #define SC_SR_MMI_DB_SPEECH_SIZE (SC_SR_SPEECH_WORD_BEGIN_MARGIN + SC_SR_SPEECH_WORD_SIZE + SC_SR_SPEECH_WORD_END_MARGIN) * SC_SR_SPEECH_FRAME_SIZE + 1 // size of the speech buffer included in a MMI database
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 96 // "+1" is for the END voice memo mask.
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 97
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 98 // DSP Out-Of-Vocabulary constant (tuning value)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 99 #define SC_SR_OOV_SFT_THR 10 // OOV rejection threhold (the lower more rejection)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 100 // if this value is equal to 0, ther's no rejection
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 101
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 102 #endif // SPEECH_RECO
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 103
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 104 #if (L1_NEW_AEC)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 105 // time interval between 2 AEC debug traces (in TDMA). Must be <= 127
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 106 #define SC_AEC_VISIBILITY_INTERVAL 52
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 107 #endif
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 108
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 109 #if (FIR)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 110 // FIR indication (fixed values)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 111 #define DL_FIR 1 // The DL FIR must be updated
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 112 #define UL_FIR 2 // The UL FIR must be updated
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 113 #define UL_DL_FIR 3 // The UL&DL FIR must be updated
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 114
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 115 #endif
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 116
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 117 // List of the error returned by the Cust_get_pointer function
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 118 #define DATA_AVAILABLE 0 // No error is occured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 119 #define SESSION_ERROR 1 // Wrong session id
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 120 #define POINTER_ERROR 2 // Wrong ptr argument
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 121 #define DATA_AVAIL_ERROR 3 // No more data available
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 122
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 123 #if (AUDIO_MODE)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 124 #define GSM_ONLY 0 // GSM normal mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 125 #define BT_CORDLESS 1 // Bluetooth cordless mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 126 #define BT_HEADSET 2 // Bluetooth headset mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 127 #endif
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 128
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 129 #if (MELODY_E2)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 130 #define SC_AUDIO_MELODY_E2_MAX_NUMBER_OF_INSTRUMENT 8 // Maximum number of instruments allowed to play in thesame time
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 131 // (Fixed value)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 132 #define SC_AUDIO_MELODY_E2_MAX_SIZE_OF_INSTRUMENT (3807 - C_DEBUG_BUFFER_SIZE)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 133 // Melody E2 instrument wave table size in the API memory
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 134 // (fixed value)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 135 #define SC_AUDIO_MELODY_E2_MAX_SIZE_OF_DSP_TRACE (C_DEBUG_BUFFER_SIZE + 1)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 136 // DSP API buffer trace size (fixed value)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 137
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 138 // Note :the melody E2 instrument are overlayed with the DSP buffer trace. The size ofthe trace buffer can
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 139 // change in order to increase the DSP tracability. In all case, the following rules need to be followed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 140 // (when melody E2 is activated):
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 141 // size of the E2 instruments buffer + size of DSP trace buffer = 2049
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 142 // size of the E2 instrument buffers > 1
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 143 // size of DSP trace buffer > 1
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 144 #endif
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 145 #endif // AUDIO_TASK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 146
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 147 // Number of coefficient for each FIR (fixed value)
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 148 #define MAX_FIR_COEF 31
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
+ − 149