Google Answers Logo
View Question
 
Q: Fitting an analog function ( No Answer,   1 Comment )
Question  
Subject: Fitting an analog function
Category: Science > Math
Asked by: highenergystar-ga
List Price: $10.00
Posted: 12 May 2003 06:22 PDT
Expires: 11 Jun 2003 06:22 PDT
Question ID: 202660
I have an analog function that I can implement only digitally. mapping
to the digital domain involves integrating under the curve and placing
a digital 'pulse' when the value reaches 1 (the analog function varies
from 1 to -1). The sampling frequency is limited to a certain N number
of pulses. This operation results in a certain digital function which
when translated/returned to analog domain results in a frequency
response that is different from the original response because of the
nature of the sampling.  The idea is to create as faithful an
implementation of the analog function as possible.  To this end i
'wiggle' the positions of pairs or quadruples of 'pulses' to see if
this results in a better analog response. the question is
1. are there any more efficient or faster algorithms to perform this
function. preferably in a more intelligent way than to traverse the
analog function (say lef tot right) and 'wiggle'
2. is there any theory behind this that i can research
the price is set at 10 will double for good hints/answers

Request for Question Clarification by mathtalk-ga on 13 May 2003 15:35 PDT
Hi, highenergystar-ga:

Your question sounds quite interesting, but I'm not clear about the
distinction between "analog" and "digital" that is central to your
problem.  It sounds somewhat like a distinction between "continuous"
and "discrete" functions, but I think some clarification of what is
meant here would encourage researchers (myself included) to
investigate this for you.

The best "guess" I can make from what you've written so far is that
both kinds of functions have a continuous time domain, but the
"analog" function takes values continuously between -1 and +1, while
the "digital" function has some discrete levels (based on number of
pulses "per unit time"?).  You then want to determine how to most
faithfully "encode" an analog function in digital form.

More information is needed about the "metric" by which the
reconstituted analog function would be compared to the original, in
order to make a reasoned recommendation.

regards, mathtalk-ga

Request for Question Clarification by endo-ga on 01 Jun 2003 14:50 PDT
Hi,
There are in fact theories, which help you determine an adequate
sampling frequency for a given analogue signal, although it would be
interesting to have an answer to the clarification requested by
mathtalk.
Thanks.
endo

Clarification of Question by highenergystar-ga on 04 Jun 2003 22:14 PDT
Hi Mathtalk,
Thanks for the interest let me try to clarify. The analog function is
indeed a continuous function. If i were to draw a plot f(t) would vary
smoothly and continuously between +1 and -1. this analog function has
to be implemented with optimum fidelity discretely. the way this
implementation is done is to integrate under f(t) and place a pulse
discrete function when the integral reaches 1 (and a negative pulse
when the integral under the curve evaluates -1)
thus f(d) is achieved

the continuous function when transferred to the 'frequency domain' via
a fft results in another continous function. f(d), when transferred to
the frequency domain (again with a fft) results in a different analog
frequency response. these 2 frequency responses are compared and the
position of the a pulse (each one being considered individually in a
left - right traverse) is 'wiggled' and evaluated to see if a better
fit was reached between the fft of f(t) and f(d)

the questions are
1. are there any more efficient or faster algorithms to perform this
function. preferably in a more intelligent way than to traverse f(d)
(say left to right) and 'wiggle'
2. is there any theory behind this that i can research 
the price is set at 10 will double for good hints/answers

hope this helps. i look forward to your help
thanks

Clarification of Question by highenergystar-ga on 04 Jun 2003 22:19 PDT
The above method described works and gives a fairly good
approximation. however it is tedious and computationally intensive and
'brute-force'. there's $10 more for an answer the will help optimize
the fit of fft[f(d1)*f(d2)] to the       fft[f(t1)convolved with
f(t2)] simultanoeusly (rather than fitting individually)

Request for Question Clarification by mathtalk-ga on 05 Jun 2003 18:32 PDT
Hi, highenergystar-ga:

I've posted an extended comment below in response to your
clarification.  While I can certainly see posting a general outline
for improved methods of approximation, if that is what you would like
to have for the offered price of $10, more concrete assistance would
require an even more precise formulation of the underlying
mathematical problem.  Please consult these Google Answers guidelines
for pricing:

http://answers.google.com/answers/pricing.html   
  
Multi-part questions are normally priced at $50 and above.  
 
regards, mathtalk-ga
Answer  
There is no answer at this time.

Comments  
Subject: Re: Fitting an analog function
From: mathtalk-ga on 05 Jun 2003 17:43 PDT
 
Hi, highenergystar-ga:

Thanks for the clarification above.  I think the most expeditious way
to proceed is to say back to you, in my words, what I understand about
your request.  That way you can correct any misunderstanding and fill
in certain gaps.  I will avoid for now the temptation to comment on
the last item, about approximating a convolution on the Fourier
transform side, because it seems we have already a very shaky platform
of building blocks (assumptions) to nail down.

Let's alter your notation a bit.  You have a continuous funtion f(t)
whose range is [-1,+1].  You don't describe the domain (in time)
although this is critical for what one might mean by the Fourier
transform of f(t), which I prefer to label F(x) to avoid confusion.

You say that F(x) is "continuous" but this is not the usual situation.
 One ordinarily supposes that f(t) is defined on some finite time
interval and by "wrapping around" makes f(t) into a periodic function
(with period equal to the length of that interval).  The Fourier
transform is then a "discrete" sequence of coefficients for the
sinusoidal "components" of f(t).  In other words the function f(t) is
expressed as a trigonometric series using the terms of the "sequence"
defined by F(x) as coefficients.

On the other hand it is reasonable, if we make certain assumptions
about f(t), to define a Fourier transform on the entire real line
(-oo,+oo) as the domain of f(t).  In particular one can do this if
f(t) has compact support, ie. is identically zero except on some
finite interval [a,b].

Adding to the confusion are your references to "fft" which is an
abbreviation for "fast Fourier transform".  A fast Fourier transform
is inherently a mapping from discrete data to discrete data (usually,
but not invariably, when the number of nodes is a power of 2).

While awaiting your clarification about the nature of the function's
domain and the kind of Fourier transform intended, let me continue
with some remarks that are applicable to more or less any sort of
Fourier transform that might be used.

The Fourier transform should certainly be a linear mapping.  That is,
given two continuous functions f(t) and g(t) in the time domain, their
linear combination:

c f(t) + d g(t)

for constants c,d will have Fourier transform:

c F(x) + d G(x)

provided F(x),G(x) are the respective Fourier transforms of f(t),g(t).

It very much seems that you have an "approximation scheme" for f(t) in
which you introduce a "step function" that I will call h(t), rather
than f(d), to emphasize that the function is defined for all the same
values of time t as f(t) is.  What is different is that h(t) takes on
discrete values, presumably jumping by some equal increments, between
-1 and +1.  I must admit your description of a "pulse function" placed
"when the integral [under f(t)] reaches 1" is not fully consistent
with this interpretation.  However if taken literally it would be
quite possible to have functions varying back and further between -1
and +1 so that the integral of f(t) never reaches either +1 or -1, so
would presumably be mapped to a zero function.

In any case there seems to be nothing "sacred" about the particular
method used to initial compute h(t), because you will immediately
raise the concern about how best to modify h(t) to some other discrete
approximation.  It is here that we need to be especially careful in
formulation.

Apparently you are not directly concerned with how well h(t)
approximates f(t), but more with how well the Fourier transform H(x)
approximates F(x).  If that is indeed the goal, then we should
probably tackle the problem directly in the "frequency" domain.

Given the linearity of the Fourier transform and some other well known
properties, such as the effect of translation h(t-a) on the Fourier
transform (a special case of the convolution theorem), it is possible
to pass from the formulation of the approximation on the time domain
side of things to the approximation on the frequency domain side.

However the approximation problem itself appears to be a nonlinear
one.  This is because (to recall a statement from your original
question) exactly N pulse functions are to be used, each of some
prescribed height (presumably chosen either positive or negative as
best suits the function) but of _unknown_ location.  In other words
you wish to approximate f(t) by h(t) of the form:

h(t) = SUM s_i j(t - a_i) FOR i = 1 to N

where j(t) is a "standard" jump function (or step function if you
prefer), and the quantities s_i are "signs" limited to {-1,+1} while
the a_i's are "locations" for the jumps.

The goal is to minimize (in a sense that needs to be made more
precise, such as "by a least squares criterion") the Fourier transform
of f(t) - h(t).  [Note: By linearity this is equivalent to minimizing
the difference of the Fourier transforms.]

Because it is a nonlinear problem, it is quite possible that the best
available algorithm will be some sort of iterative process close, at
least in spirit, to the "wiggling" described by your clarification. 
However an iterative process need not be "brute force", and at least a
super-linear convergence should be expected with the right algorithm. 
With a clear statement of the "objective" function (the quantity to be
minimized) it is even possible that an explicit solution is available.

Many times one is happy to have a proof that the solution obtained by
a numerical approach has an error that is no worse than some
prescribed constant times the best possible error, and it is even more
likely that such "near optimal" solutions can be easily (i.e.
"quickly") found.

In this connection I'll make one final observation, namely that the
Fourier mapping from square integrable functions on the real line to
square integrable functions on the real line can be shown to be
bounded and have bounded inverse.  That is, the least squares error on
the time domain side can be used to estimate the least squares error
on the frequency domain side and conversely.  In fact with a certain
amount of fiddling with the metrics, the mapping is an isometry
(Plancherel theorem), meaning that the "size" of a function and of its
Fourier transform (in a modified least squares sense) are equal.

The point of this is to indicate that for "near optimal"
approximations in the least squares sense, one has the choice of
working either in the time domain or the frequency domain, whichever
is convenient.

best wishes,
mathtalk-ga

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy