Optimization and Armstrong modulation
November 15th, 2005 ~ Posted in: Mathematics, ProgrammingI generally don’t have the level of interest required to sit down and read a huge treatise on optimization. That eliminates just about all the optimization books I’ve seen. Someday, in graduate school, I hope to take a series of classes that will open up that world to me, but until then, I’ll have to resort to ad hoc solutions.
In my latest telecomm homework assignment, we had to design an indirect Armstrong FM modulator— a device used to create wideband FM signals. The problem is that it involves a variable number of frequency multiplication steps, with a frequency mixing somewhere in the middle of the process. I must determine, among other things, the number of frequency doublings
and triplings
to do before mixing, what frequency to mix at
, and how many frequency doublings and triplings to do after mixing (
and
). If you consider it as a system to be optimized, there are 6 parameters to be optimized, five of which are related by the equation
The other is a frequency deviation parameter
which I’d like to satisfy the equation
.
The interesting thing about this problem is the fact that
have to be positive integers, and
have to be within certain ranges. I ended up coding this up in Python: the program accepts the two continuous variables as input, and steps through the discrete ones to find optimal values. The engineer in me was satisfied with the results, but I wonder what kind of theories out there address problems like that. The mathematician in me would like to be able to find a provably optimal, acceptable solution.
Since I’m sure someone will ask me about this question tomorrow, I’ve attached it
[python]
import math
“”" Really crappy program to help design an indirect Armstrong FM modulator. Given some
parameters, tells you p,q,n,m coefficients for cascaded frequency doublers and triplers.
(p, q) are for the numbers of (doubling, tripling) before frequency conversion,
(n,m) are for the number after. Parameters:
df0 - freq deviation of input [Hz]
fs - frequency of oscillator used for frequency mixing [kHz]
ff - output frequency desired [kHz]
dff- output frequency deviation desired [Hz]
f0 - frequency of input oscillator [kHz]
maxexp - range of values to try for p,q,n,m (higher = longer, but probably pointless, run)
“”"
df0 = 9
fs = 10.6*1000.
ff = 88.7*1000.
dff = 75*1000.
f0 = 120.
maxexp = 10
def freqdiff(p, q, n, m):
return ((f0*2**(p+n)*3**(q+m) - fs*2**n*3**m) - ff)/1000
def devdiff(p,q,n,m):
return (dff - 2**(p+n)*3**(q+m)*df0)/dff
def optimizearmstrong():
oldval = 200^2
for p in range(maxexp):
print “testing p=”, p
for q in range(maxexp):
for n in range(maxexp):
for m in range(maxexp):
newval = freqdiff(p, q, n, m)**2 + devdiff(p, q, n, m)**2
if math.sqrt(newval) < math.sqrt(oldval):
oldval = newval
oldp = p
oldq = q
oldn =n
oldm = m
print “p=”, oldp, “q=”, oldq, “n=”, oldn, “m=”, oldm
print “freq [MHz]=”, (f0*2**(oldp+oldn)*3**(oldq+oldm) - fs*2**oldn*3**oldm)/1000, \
“dev [kHz]=”, 2**(oldp+oldn)*3**(oldq+oldm)*df0/1000
optimizearmstrong()
[/python]

This entry was posted on Tuesday, November 15th, 2005 at 12:06 am and is filed under Mathematics, Programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply