Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

generating Pure tone Using Codec IC

Status
Not open for further replies.

kiransbaddi

Member level 2
Joined
Nov 30, 2015
Messages
51
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
427
HI

I want to Generate pure tone from 1kHz to 8kHz Signal Using MONO-Codec IC

Here What I Have
I m using DSP controller to Store the Lookup table of Sinewave (Mostly Program memory)
MIcrocontroller Communicate With Codec IC Using I2C and I2S protocol to set the Registers(I2C) Data for Output(I2S)
Sampling frequency : 44.1 kHz
Each Word :16Bit
Frames/ Word : 1 frame /1Word
Values in LookUp table : 176 For 1 sinewave
Required frquency : 250Hz, 500Hz, 1kHz, 2kHz,...

Can Anybody help me how i have to select Bit-Clock for Different frequencies
 

The bit clock is commanded by the coded sampling frequency and doesn't depend on input signal.

Different output frequencies are generated by changing the table address increment. You are by the way no restricted to integer multiples of 250 Hz, by using a NCO scheme, you can generate arbitrary signal frequencies.
 
Hi Mr. FvM

Thank you for your kind reply. Do you Mean I have to Change System PLL value ? If so then wouldn't it change my system frequency every time?
 

No. You'll increment the look-up table address with fixed 44.1 kHz, but use different increments to achieve different sine frequencies.
 

Hi,

I want to Generate pure tone from 1kHz to 8kHz Signal Using MONO-Codec IC
How does this fit to:
Required frquency : 250Hz, 500Hz, 1kHz, 2kHz,...

I´d like to add the word "phase" here:
You'll increment the look-up table address with fixed 44.1 kHz, but use different phase increments to achieve different sine frequencies.

Example:
If you want to generate 1kHz and you have a sample clock of 44.1kHz.

Obviously you need 44.1 samples for one full wave.
Since one full wave is 360° --> you neeed a phase increment of 360° x 1kHz / 44.1kHz = 8,163°.

Use a phase counter with range of 0...360°, but with fractionals. maybe a 16 bit unsigned integer with 9 bits integer and 7 bits fractional.
0biiii iiii ifff ffff
use a phase increment value with same 9 bits integer and 7 bits fractional.

for a phase increment use: 0b 0000 0010 0001 0101 (this is closest to 8.163°)
This results in an output frequency of 1000.0977Hz

after adding phase increment:
* when carry flag is set: subtract 360°
* when value >=360° then subtract 360°

You may set any frequency in step size of 0.957Hz

Now you have phase information value 0...360°.
Calculate what table entry to use.
Either select the closest one or do interpolation.
Then output this value to the DAC.

You may use Excel to simulate all this.

Klaus
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top