1 / 28

Audio Processing

Audio Processing. Yongchang, Kai, Justin, Rama. Audio Processing. System Analysis. Input: Raw WAV Format Data Output: Normalized Wave Signal. System Analysis (continued) Step 1: Preprocessing. Input: Raw WAV Format Data Output: Preprocessed Wave Data Set Sample Rate: 8k Hz

lenamunoz
Download Presentation

Audio Processing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Audio Processing Yongchang, Kai, Justin, Rama

  2. Audio Processing

  3. System Analysis • Input: Raw WAV Format Data • Output: Normalized Wave Signal

  4. 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

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

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

  7. 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

  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. Basic Wave File Format

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

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

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

  13. Preprocessed Wave Format Normalized Data

  14. Raw Data Legal Format ? No Report Error Yes Preprocessing Preprocessed Data System Designfor Preprocessor

  15. System Designfor 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. • Return value: • 0 – Successfully • Negative value – There exists error

  16. File ID Yes Is playing ? Ignore and Return No Initializing Finally process and Return Yes playing Over? No Play System Designfor AudioProcessor ( Concept )

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

  18. System Designfor 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

  19. System Designfor 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:

  20. System Designfor 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:

  21. System Designfor 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

  22. Testing • Preprocessor passed testing • AudioProcessor passed testing

  23. Demo of Preprocessor I

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

  25. Status • Problem: • 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.

  26. 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

  27. Thanks for your attention

More Related