Skip to content Skip to navigation

OpenStax_CNX

You are here: Home » Content » Wavelet Denoising

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.

Also in these lenses

  • Lens for Engineering

    This module is included inLens: Lens for Engineering
    By: Sidney Burrus

    Click the "Lens for Engineering" link to see all content selected in this lens.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

Wavelet Denoising

Module by: Jacob Fainguelernt. E-mail the author

Summary: Wavelets can be used in a wide range of applications, one of which is noise reduction. This module shows a real-time implementation of a wavelet-based noise reduction in the DSK6713. A Simulink model is created for simulation, and afterwards used for DSP code generation.

Introduction

Wavelets can be used in a range of applications, one of which is noise reduction.

This laboratory shows how to design a model of Wavelet Noise Reduction using Simulink and run it on a Texas Instruments C6000 DSP.

Objectives

  • Design a model of Wavelet Noise Reduction for the Texas Instruments C6000 family of DSP devices using MATLAB® and Simulink®.
  • Modify an existing Simulink demonstration model.
  • Run the project on the Texas Instruments C6713 DSK with a microphone and computer loudspeakers / headphones.

Level

Intermediate. Assumes prior knowledge of MATLAB and Simulink. It also requires a theoretical understanding of wavelets and some knowledge of Texas Instruments DSPs.

Hardware and Software Requirements

This laboratory was originally developed using the following hardware and software:

  • MATLAB R2006b with Embedded Target for TI C6000.
  • Code Composer Studio (CCS) v3.1
  • Texas Instruments C6713 DSK hardware.
  • Microphone and computer loudspeakers / headphones.

Related Files

Simulation

Simulink Model

The Simulink model described here is based on a MATLAB Demo.

Opening the Model

Open WaveletDenoising.mdl

Figure 1: Opening WaveletDenoising.mdl
Figure 1 (graphics1.jpg)

Running the Model

Run the model. The colors change to show the different filter channels. Green = high frequency.

Figure 2: Wavelet Model Showing Color Coding
Figure 2 (graphics2.jpg)

Scope Output

The scope output shows how the random noise has been separated out (Residual).

Figure 3: Scope Output
Figure 3 (graphics3.jpg)

Monitoring the Dyadic Filter Outputs

Add an extra scope as shown in Figure 4 to display the Diadic Filter Outputs.

Figure 4: Monitoring the Dyadic Filter Outputs
Figure 4 (graphics4.jpg)

Analysis of Diadic Filter Outputs

It can be seen that the noise is on Out1, Out2 and Out3. The clean input signal is on Out4.

Figure 5: Noise Levels at Dyadic Filter Outputs
Figure 5 (graphics5.jpg)

Modifying the Dead Zone

Double-click on the “Soft Threshold” block. This is the actual noise reduction stage. The fields are in order Out1, Out2, Out3 and Out4.

Figure 6: Noise Levels at Dyadic Filter Outputs
Figure 6 (graphics6.jpg)

Here Out1 has been given a threshold of 3. This means that only values > 3 are let through.

Out2, Out3 and Out4 have been given the value of 0. This means the whole signal is let through.

The output is shown in Figure 6. Note that the noise associated with Out2 and Out3 have not been reduced.

Figure 7: Threshold only applied to Out1
Figure 7 (graphics7.jpg)

Changing the Delay Alignment

Double-click on the “Delay Alignment” block. Temporarily remove the delays on Out1 and Out2.

Figure 8: Removing the Delay Alignments
Figure 8 (graphics8.jpg)

Run the model to see the effect.

Summary of Simulation

From practical experimentation using the Simulink model, you should now understand how wavelet denoising works.

Real-Time Model for TI C6713 DSK

Texas Instruments C6713 DSK Setup

Figure 9: Texas Instruments C6713 DSK Setup
Figure 9 (fig9.jpg)

Simulink Model for C6713 DSK

Starting Code Composer Studio

Start Code Composer Studio for C6713 DSK and use Debug -> Connect.

Figure 10: Startup Screen for Code Composer Studio (CCS)
Figure 10 (fig10.jpg)

Opening an Existing Model

Start MATLAB 7.3.0 R2006b:

Figure 11: Opening an Existing Demo
Figure 11 (graphics11.jpg)

Click on “Demos”. The following screen will appear:

Figure 12: Selecting the Audio Demo Models
Figure 12 (graphics12.jpg)

Highlight “Embedded Target for TI C6000 DSP” then “Audio”. Click on “Wavelet Denoising”.

Viewing the Wavelet Denoising Parent

The “Wavelet Denoising” model is now displayed. Double-click on the “function()” box.

Figure 13: Wavelet Denoising Parent
Figure 13 (graphics13.jpg)

The Original Wavelet Noise Reduction Algorithm

The “Wavelet Noise Reduction Algorithm” model is now displayed.

Figure 14: Wavelet Denoising Algorithm
Figure 14 (graphics14.png)

Copying the Model

For convenience, copy the model to the MATLAB “Work” directory where most models are stored.

Figure 15: Copying the Model to the MATLAB “Work” directory
Figure 15 (graphics15.jpg)

Overview of the Modified Model

In order to run the model on the C6713 DSK and be able to compare the performance with and without noise reduction, we will make some small modifications to the demo model.

Figure 16: The Modified Algorithm
Figure 16 (graphics16.jpg)

You will now update the existing model by dragging-and-dropping some library components onto the model.

Changing the Input to Microphone

Double-click on the blue box to the left marked “C6713 DSK ADC”. The following options will appear.

Figure 17: Setting up the ADC for Microphone Input
Figure 17 (graphics17.jpg)

Change the “ADC source” to “Mic In” and tick the “Stereo” box. If you have a quiet microphone, tick the “+20dB Mic gain boost” box. When done, click on “OK”.

The DAC Settings

The DAC settings need to match those of the ADC. Check that they are the same.

Figure 18: Setting the DAC Parameters
Figure 18 (graphics18.jpg)

Adding a DIP Switch and LED

To change between no wavelet denoising and with wavelet noise reduction, we will use a DIP switch of the C6713 DSK.

Figure 19: Adding a Switch and LED
Figure 19 (graphics19.jpg)

Select View -> Library Browser -> Embedded Target for TI C6000 DSP. Highlight “C6713 DSK Board Support”.

Drag-and-drop the “Switch” block onto the model. Also drag-and-drop the “LED” block onto the model.

DIP Switch Settings

The DIP switch needs to be configured. Double-click on the “Switch” block.

Put at tick in all of the boxes and set “Data type” to Integer. The “Sample time” should also be set to “–1”.

Figure 20: Setting up the DIP Switch Value
Figure 20 (graphics20.jpg)

Adding a Constant, Switch and Relational Operator

We now need to setup a way to switch between straight through without noise reduction and with wavelet noise reduction.

Select View -> Library Browser -> Simulink. Highlight “Commonly Used Blocks”.

Drag-and-drop a “Constant” onto the model.

Drag-and-drop a “Switch” block onto the model.

Drag-and-drop a “Relational Operator” block onto the model.

Figure 21: Selecting the Commonly Used Blocks
Figure 21 (graphics21.jpg)

Setting the Constant Value

The switch values lie between 0 and 15. We will use switch values 0 and 1. Double-click on the “Constant” block. Set the “Constant value” to 1 and the “Sample time” to “inf”.

Figure 22: Setting the Echo Delay Gain
Figure 22 (graphics22.jpg)

Setting the Constant Data Type

Click on the “Signal Data Types” tab. Set the “Output data type mode” to “int16”. This is compatible with the DAC on the C6713 DSK. Click on “OK”.

Figure 23: Data Type Conversion to 16-bit Integer
Figure 23 (graphics23.jpg)

Setting the Relational Operator Type

Double click on the “Relational Operator” block. Change the “Relational operator” to “==”. Click on the “Signal Data Types” tab.

Figure 24: Changing the Relational Operator
Figure 24 (graphics24.jpg)

Setting the Relational Operator Data Type

Set the “Output data type mode” to “Boolean”.

Figure 25: Changing the Output Data Type
Figure 25 (graphics25.jpg)

Joining the Blocks

Move the blocks and join them as shown in the Figure below.

Figure 26: Joining the Blocks
Figure 26 (graphics26.jpg)

Checking the Dyadic Analysis Filter Bank

Double click on the “Dyadic Analysis Filter Bank” block. The values of the Dyadic Analysis Filter Bank are shown below. You do not need to change them yet. Click on “OK”.

Figure 27: Checking the Dyadic Analysis Filter Bank
Figure 27 (graphics27.jpg)

Checking the Delay Alignment

The delay alignment is shown below, with different delay times for the different frequencies.

Figure 28: Checking the Delay Alignment
Figure 28 (graphics28.jpg)

Checking the Soft Threshold

The “Soft Threshold” sets the threshold below which noise is ignored for each of the four channels. Zero means no noise reduction.

Figure 29: Checking the Thresholds
Figure 29 (graphics29.jpg)

Checking the Dyadic Synthesis

Double-click on the “Dyadic Synthesis Filter Bank”. There is no need to change the values at this time. Click on “OK” when done.

Figure 30: Checking the Dyadic Synthesis Filter Bank
Figure 30 (graphics30.jpg)

Returning to the Parent System

From the Toolbar, select the “Up Arrow” icon. This returns you to the next higher level.

Figure 31: Returning to the Parent System
Figure 31 (graphics31.jpg)

Building the Model

Selecting Real-Time Workshop

Select Tools -> Real-Time Workshop -> Build Model.

Figure 32: Building the Model
Figure 32 (graphics32.jpg)

The Completed Model Running on Code Composer Studio

From the folders on the left, select the source code for the project.

Figure 33: The Completed Model Running under Code Composer Studio
Figure 33 (fig33.jpg)

Different Settings on the C6713 DSK

Microphone Straight Through to Loudspeakers

To check out the microphone and loudspeakers, set the DIP switches on the C6713 DSK as follows:

Figure 34: Switch Position 0
Figure 34 (graphics34.jpg)

The microphone is fed directly to the loudspeakers. There is no noise reduction.

Switch Position for Wavelet Noise Reduction

To run the “Wavelet Noise Reduction” subsystem, set the DIP switch to 1.

Figure 35: Switch Position 1 for Wavelet Noise Reduction
Figure 35 (graphics35.jpg)

Modifying the Model

The next stage is to modify the model. We will change the wavelet type to “Symlets”.

Changing the Filter Type

Double-click on the “Dyadic Analysis Filter Bank” block. Change the “Filter” field to “Symlets”. Click on “OK”.

Figure 36: Dyadic Analysis Filter Bank set to Symlets
Figure 36 (graphics36.jpg)

Updating the Dyadic Synthesis Filter Bank

The wavelet type should be the same as that used in the Dyadic Analysis Filter Bank. Double-click on the “Dyadic Synthesis Filter Bank” block. Change the “Filter” field to “Symlets”. Click on “OK”.

Figure 37: Configuring the Dyadic Synthesis Filter Bank
Figure 37 (graphics37.jpg)

Building the Model

Select Tools -> Real-Time Workshop -> Build Model.

Figure 38: Building the Model
Figure 38 (graphics38.jpg)

Running the Updated Model

Run the updated model and listen to the effect of using different filter types.

Some Things to Try

You may wish to experiment with different settings. Here are some suggestions.

Change the Wavelet Types

Inside the “Dyadic Analysis Filter Bank” are different wavelet types. Which are suitable for wavelet denoising and which are not? Note: you will also have to alter the values used in the “Dyadic Synthesis Filter Bank”.

Figure 39: Available Wavelet Types
Figure 39 (graphics39.jpg)

Change the Delay Alignment Times

Experiment with the delay alignment times. Try higher and lower values.

What is the effect of completely removing the “Delay Alignment” block?

Change the Noise Reduction Thresholds

In the “Soft Threshold” block, change the values. The existing vector of [3, 2, 1, 0] reduces high frequency noise, but does not affect low frequencies.

Create Your Own Subsystem

Add your own subsystem block controlled by the DIP switches and add your own wavelet denoising algorithm. Choose your own wavelet, number of channels, sampling frequency and thresholds.

Content actions

Download module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks