Presentation is loading. Please wait.

Presentation is loading. Please wait.

Yongchang, Kai, Justin, Rama

Similar presentations


Presentation on theme: "Yongchang, Kai, Justin, Rama"— Presentation transcript:

1 Yongchang, Kai, Justin, Rama
Audio Processing Yongchang, Kai, Justin, Rama

2 Audio Processing

3

4 System Analysis Input: Raw WAV Format Data
Output: Normalized Wave Signal

5 System Analysis (continued) Step 1: Preprocessing
Input: Raw WAV Format Data Output: Preprocessed Wave Data Set Sample Rate: 8k Hz Channels: 1 = Mono Bits Per Sample: 8 bits

6 System Analysis (continued) Step 2: Audio Processing
Input: Preprocessed Wave Data Set Output: Single Wave Signal

7 Audio Processing Preprocessing Channel
Preprocessed Wave Data Audio Processing Each Signal to Be Played Raw WAV Format Data Preprocessing Channel

8 System Analysis (continued)
Preprocessed input data: Illegal format – thrown away Legal format – converted to the suitable format Preprocessing is very important Save the cost of the satellite Time Space Decrease risk: illegal data can make the satellite system crash

9 System Analysis (continued)
Preprocessed input data: Illegal format – thrown away Legal format – converted to the suitable format Preprocessing is very important Save the cost of the satellite Time Space Decrease risk: illegal data can make the satellite system crash

10 Basic Wave File Format The “RIFF” Chunk The “fmt” Sub-chunk
The “data” Sub-chunk

11 Basic Wave File Format The “RIFF” Chunk The “fmt” Sub-chunk
Unit: Byte( s ) "WAVE" 36 + SubChunk2Size "RIFF" Comment 4 ChunckSize Format 8 ChunkID Size Field Offset The “data” Sub-chunk The “fmt” Sub-chunk The “RIFF” Chunk

12 Basic Wave File Format The “RIFF” Chunk The “fmt” Sub-chunk
8 bits = 8, 16 bits = 16, etc 2 BitsPerSample 34 NC * BPS / 8 BlockAlign 32 SR*NC*BPS/8 4 ByteRate 28 8k, 44.1k, etc SampleRate 24 Mono = 1, Stereo = 2, etc NumChannels 22 PCM = 1 16 for PCM "fmt " Comment Subchunk1Size 16 AudioFormat 20 Subchunk1ID 12 Size Field Offset The “data” Sub-chunk The “fmt” Sub-chunk The “RIFF” Chunk SR = SampleRate, NC = NumChannels BPS = BitsPerSample

13 Basic Wave File Format The “RIFF” Chunk The “fmt” Sub-chunk
The actual sound data NumSamples * NumChannels * BitsPerSample/8 “data" Comment 4 Subchunk2Size 40 * Data 44 Subchunk2ID 36 Size Field Offset The “data” Sub-chunk The “fmt” Sub-chunk The “RIFF” Chunk

14 Preprocessed Wave Format
Offset Field Size Comment DataSize 4 Little Endian, (uint32) Data * The actual sound data : Sample Rate: 8k Hz Channels: 1 = Mono Bits Per Sample: 8 bits Normalized Data

15 System Design for Preprocessor
Raw Data Legal Format ? Report Error No Yes Preprocessing Preprocessed Data

16 System Design for Preprocessor
int LoadRawFile( char * apchRawFileName ); Load the raw format wave file and check it. pchRawFileName: File name of the raw wave file. Return value: 0 – Successfully Negative value – There exists error int ConvertTo( char * apchNewFormatFile ); Convert the legal wave data to the preprocessed format pchNewFormatFile: File name of the preprocessed data.

17 System Design for AudioProcessor ( Concept )
File ID Is playing ? Yes No Initializing playing Over? Play Ignore and Return Finally process and Return

18 System Design for AudioProcessor ( Implement )
File ID Is playing ? Yes No Initializing Hardware and Software Ignore Start Timer Return playing Over? Yes No Send One Byte to DAC Stop Timer and Return OnTimer Return

19 System Design for AudioProcessor
int play_audio( char * apchFileID ); Initialize hardware and software and be ready for playing. apchFileID: Wave file to be played. Return value: 0 – To be played. -1 – Request is ignored void write_data_onto_DAC( void ); To be called when TimerB18000 interrupt occurs void initialise_hw( void ); Initialize hardware for playing sound

20 System Design for AudioProcessor ( About DAC )
DAC12_1CTL = DAC12IR + DAC12AMP_5 + DAC12ENC; DAC12IR: In DAC12_xCTL, DAC12 Control Register. Bit 8. DAC12 input range. This bit sets the reference input and voltage output range. 0 DAC12 full-scale output = 3x reference voltage 1 DAC12 full-scale output = 1x reference voltage DAC12AMPx: DAC12ENC:

21 System Design for AudioProcessor ( About DAC )
DAC12_1CTL = DAC12IR + DAC12AMP_5 + DAC12ENC; DAC12IR: DAC12AMPx: In DAC12_xCTL, DAC12 Control Register. Bits : 7-5 DAC12 amplifier setting. These bits select settling time vs. current consumption for the DAC12 input and output amplifiers. DAC12ENC:

22 System Design for AudioProcessor ( About DAC )
DAC12_1CTL = DAC12IR + DAC12AMP_5 + DAC12ENC; DAC12IR: DAC12AMPx: DAC12ENC: In DAC12_xCTL, DAC12 Control Register. Bit 1. DAC12 enable conversion. This bit enables the DAC12 module when DAC12LSELx > 0. when DAC12LSELx = 0, DAC12ENC is ignored. 0 DAC12 disabled 1 DAC12 enabled

23 Testing Preprocessor passed testing AudioProcessor passed testing

24 Demo of Preprocessor I

25 Demo of Preprocessor II
The output file is a *.h file, so that we can directly include this file and get the data.

26 Status Problem: Solution:
There is no file system API, so real audio files can’t be processed. Solution: Now we use a char array to simulate an audio file. ( less flexibility ) Maybe resolving packets directly will be more elegant.

27 Future Wait for the file system APIs? ( or solve it ourselves )
Re-design audio processing APIs? Flexible ( not only play 8k Hz audio ) Extensible ( multimedia processing ) Available ( non-stop service ) Reliable ( not a toy ) Maintainable

28 Thanks for your attention


Download ppt "Yongchang, Kai, Justin, Rama"

Similar presentations


Ads by Google