Post Go back to editing

a question about the delay time based on adsp-21489 block processing mode

Here is a fraction of c code in one  adsp21489 demon program. My question is how many the delay time occurring --one block length ,or 2 block length. My understanding is that one block-long time for sampling dates, another block-long time for processing ,and once the third input block coming, the first already processed block dates output synchronously. So all the delay time is two block-long . Is it right or not?  And I also wonder to know how the 3 procedures , input, processing, and output, work synchronously and accordingly. 

  Thanks a lot!

/////////////////////////////////////////////////////////////////////////////////////
// This function handles the Codec data in the following 3 steps...
// 1. Converts all ADC data to 32-bit floating-point, and copies this 
//    from the current RX DMA buffer into fBlockA & fBlockB
// 2. Calls the audio processing function (processBlocks)
// 3. Converts all DAC to 1.31 fixed point, and copies this from 
//    fBlockA & fBlockB into the current TX DMA buffer
/////////////////////////////////////////////////////////////////////////////////////

void handleCodecData(unsigned int blockIndex)
{
    //Clear the Block Ready Semaphore
    inputReady = 0;

    //Set the Processing Active Semaphore before starting processing
    isProcessing = 1;

    // Float ADC data from AD1939
	floatData(fBlockA.Rx_L1, rx_block_pointer[blockIndex]+0, NUM_RX_SLOTS, NUM_SAMPLES);
	floatData(fBlockA.Rx_R1, rx_block_pointer[blockIndex]+1, NUM_RX_SLOTS, NUM_SAMPLES);
	floatData(fBlockA.Rx_L2, rx_block_pointer[blockIndex]+2, NUM_RX_SLOTS, NUM_SAMPLES);
	floatData(fBlockA.Rx_R2, rx_block_pointer[blockIndex]+3, NUM_RX_SLOTS, NUM_SAMPLES);

	// Place the audio processing algorithm here. 
	process_audioBlocks();

    // Fix DAC data for AD1939
	fixData(tx_block_pointer[blockIndex]+0, fBlockA.Tx_L1, NUM_TX_SLOTS, NUM_SAMPLES);
	fixData(tx_block_pointer[blockIndex]+1, fBlockA.Tx_R1, NUM_TX_SLOTS, NUM_SAMPLES);
	fixData(tx_block_pointer[blockIndex]+2, fBlockA.Tx_L2, NUM_TX_SLOTS, NUM_SAMPLES);
	fixData(tx_block_pointer[blockIndex]+3, fBlockA.Tx_R2, NUM_TX_SLOTS, NUM_SAMPLES);
	fixData(tx_block_pointer[blockIndex]+4, fBlockA.Tx_L3, NUM_TX_SLOTS, NUM_SAMPLES);
	fixData(tx_block_pointer[blockIndex]+5, fBlockA.Tx_R3, NUM_TX_SLOTS, NUM_SAMPLES);
	fixData(tx_block_pointer[blockIndex]+6, fBlockA.Tx_L4, NUM_TX_SLOTS, NUM_SAMPLES);
	fixData(tx_block_pointer[blockIndex]+7, fBlockA.Tx_R4, NUM_TX_SLOTS, NUM_SAMPLES);
	
    
    //Clear the Processing Active Semaphore after processing is complete
    isProcessing = 0;
}