马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
我现在需要做一个关于AUDIO GAIN COMPRESSOR的实验报告,可是我对MATLAB的使用又不是很熟悉,希望各位大哥大姐能帮帮我,万分感谢。以下是实验要求:
In this laboratory project you are asked to write a real-time C program for theTMS320VC5510 that samples audio data of
48000 samples/second.
Your program must break the speech up into 30 ms frames.
This is to be done by storing the speech samples in a 0.030 s * 48000 samples/second = 1440 element buffer.
Each time the array “wraps around to the top location” corresponds to a new 30 ms frame.
During each sample period, you should update a sum variable in your interrupt routine.
The absolute value of the new sample should be added to the sum.
Then, when the buffer wraps (the buffer array index variable is set back to zero), the sum of the last 1440 absolute values can be divided by 1440 to determine the average audio magnitude value (AVG_MAG_OF_FRAME) for the 30 ms frame.
The oldest value in the buffer, which corresponds to the oldest value in the previously recorded frame, may then be multiplied by the scaling constant (DESIRED_AV_MAG) / (AVG_MAG_OF_FRAME), and sent out to the D/A converter.
This should happen with each interrupt, so that after 240 more interrupts, the entire "amplitude scaled" frame will be sent to the D/A converter.
Note that each frame will be scaled (each of the 240 samples in the frame will be multiplied by the scaling constant) to have the same average magnitude value, "DESIRED_AV_MAG".
Also, note that the output of this digital gain compression system will lag the present input by 30 ms, which is a barely perceptible delay.
If the AVG_MAG_OF_FRAME falls below a "zero threshold" value (ZERO_THRESHOLD), which you will have to experimentally determine, set the entire 240-sample frame to zero, as you send it out to the D/A converter.
You will need to experiment with appropriate DESIRED_AVG_MAG and ZERO_THRESHOLD values.
You will also have to decide whether to implement this routine in floating point or fixed point (fixed point may be more challenging, but it can be implemented more cheaply.)
You should test your program with both a microphone and a 400-Hz sine-wave generator, whose gain is varied.
You should be able to demonstrate nearly constant output (no more than 1 dB variation) while the output is varied over a least a 10:1 (20 dB) amplitude range.
[ 本帖最后由 eight 于 2008-1-10 09:38 编辑 ] |