In the ad1939.h,I can choice 256,384,512,768 samples per frame.Now i want to choice 480 samples per frame.How do I achieve it?
The code in ad1939.h looks like this：
This setting is for the relationship between the master clock input and the sample rate. It is a divisor for the PLL. So they would be 256x fs or 384 x fs etc. The majority of hardware is setup for 256 x fs which means for a 48kHz fs you would need a master clock of 12.288MHz. I think this is what is on the DSP evaluation board. I support the AD1939 codec and not the Sharc DSP products.
The codec is not capable of a serial format of 480 samples per frame and no part exists that can do that. The most you can do with this codec is 16 samples per frame. Do you mean to ask about bit clock cycles per frame? TDM 16 with a channel slot size of 32 bits will be 16 x 32 = 512 bit clocks per frame. 480/32 = 15 channels per frame. This is not a standard TDM rate. If you have a 24 bit size slot then 480/24 = 20 channels. Again this is not standard.
So what are you trying to achieve? What are your applications needs for channel count and word sizes and channel slot sizes for a serial transmission?
Thank you Dave Thib!
Because I want to port an audio algorithm to 21489, this algorithm uses 48K sampling in both PC and phone, 10ms a frame (ie 480 sampling points) for processing. I thought that ADSP21489 can let users use ad1939 to configure the sampling points per frame Head. According to what you said, ad1939 supports a maximum of 16 sample points per frame, right? Thank you for your answer!
I am currently new to ADSP. I checked the relevant information and finally figured it out, thank you Dave T. Here I have an additional question. In the Talkthrough sample code, I found the code shown below. I want to ask why r1 = -31? Thank you for your answer!
So you need to process 480 samples and you are calling that a "Frame". A "Frame" in my vocabulary means one sample period. So I am thinking you are asking the codec to transmit 480 samples EVERY sample period which is not possible. You are asking how to collect 480 samples over a 10ms time span for processing. Like you would do for a 480 point FFT. So I am not certain how to do this since I do not work with the SHARC products but I am assuming you would setup two buffers 480 words long, one for processing the data and one for collecting new samples while you are processing the previous block of data. I call the 480 samples a "block" not a "Frame". Now that we got that straight we can understand what you are asking for much more clearly! Thanks for clarifying.
Regarding the f1=-31. Again, I am not a SHARC programmer. Since on the next lines r1 is used in a float command, I am assuming it means to take the incoming 2's compliment sample and translate it to a float with a 31 bit mantissa? Why it needs to be negative I am not certain. So hopefully someone on this forum who supports the SHARC can help you here. It is a library function so there should be a help file on the float command.
Hello Dave T,
Your answer can help me a lot. Thank you very much for your answer.I will try to implement it using your method to see if it works.