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.

[SOLVED] [moved] Help me re-work this simple equation & solving a language barrier.

Status
Not open for further replies.

David_

Advanced Member level 2
Joined
Dec 6, 2013
Messages
573
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,308
Location
Sweden
Activity points
12,222
Hello.

Math has never been my strong side but I am trying to learn things I with certainty should have learned a long time ago, but I can't research the subject online since I don't know the English terminology for what am looking for.

I have these two equation:

fo = (FTW)(fs)/2³² with 0 ≦ FTW ≦ 2³¹
fo = fs*(1-(FTW/2³²)) with 2³¹ < FTW < 2³² - 1

This comes from a DDS chip datasheet and
fo = output frequency
fs = system clock frequency
FTW = Frequency Tuning Word.

I want to re-write the equations so that I can use it to find out what FTW I need to gain a specific fo, and I think it should be a simple matter of re-arranging the equations, that is simple if you do know how this sort of thing is done(which I don't).

Could someone show me how(to re-arrange the equations give the FTW needed for a specific fo) and tell me what category of mathematics I need to learn about, this is just one of many cases where I am hindered by my lack of mathematical knowledge and I experience that in many cases application notes give you all you need in the form of a starting or original equation but that is nothing if I can't re-work it.

I want to use this to write a C function that will be used as:
FTW = Hz_out(200000); // tuning word needed for a 200kHz output

I also fail to understand what the conditions for when which equation should be used actually says, this is regarding a DDS with a 32-bit frequency tuning word and I do get that 0 ≦ FTW ≦ 2³¹ means 0 is less than or equal to FTW while FTW is less than or equal to 2³¹(2 147 483 648)
and that 2³¹ < FTW < 2³² - 1 means when 2³¹(2 147 483 648) is less than FTW while FTW is less than 2³² - 1(4 294 967 295), but why would the equations be different for when the tuning word is between 0 & 2³¹ and when the tuning word is between 2³¹ & 2³² - 1?
This might be a little to DDS specific for this thread but if anyone reading this knows why please enlighten me.

I would appreciate any help very much.
Regards
 

fo = (FTW)(fs)/2³² with 0 ≦ FTW ≦ 2³¹
for the above:
FTW is;
FTW=(fo*2^32)/fs

-----------
fo = fs*(1-(FTW/2³²)) with 2³¹ < FTW < 2³² -
1


for this , FTW is:
FTW=(1-(fo/fs))*2^32
 
  • Like
Reactions: David_

    David_

    Points: 2
    Helpful Answer Positive Rating
fo = FTW * Fs / 232
Multiply both sides by 232 and cancel:
232 *fo = FTW * Fs
Divide both sides by Fs and cancel:
232 * fo / Fs = FTW

FTW = (232 / Fs) * fo (How I would probably implement in fixed point C, it makes the first part a constant.

It is just high school algebraic manipulation, any math book aimed at 14 - 16 year olds will cover this stuff.

The reason for the two equations is that at Fs/2 you reach the limit of the sampling theorem so the signal in the first Nyquest zone becomes the alias hence the different equation.

I would note that you can reach any frequency up to (But not including) Fs/2 just using the first set of maths, so the second one is basically a curiosity unless you need the thing to tune the other way (Which actually can be useful).

Regards, Dan.
 
  • Like
Reactions: David_

    David_

    Points: 2
    Helpful Answer Positive Rating
Thank you.
I don't know why I didn't think of it but I do have all my math books from my time in school, somewhere...
Good tip, thanks.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top