Forums

Rectified FFT

Started by Benjamin M. Stocks December 5, 2003
"Robert Gush" <robert@suesound.co.za> wrote in message
news:a0f35ea5.0312100614.18bae255@posting.google.com...
> stocksb@ieee.org (Benjamin M. Stocks) wrote in message
news:<132e56ad.0312090748.4c829fe@posting.google.com>...
> > "Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message > > > Is that the case? Do you know that it's a linear system? Your
descriptions
> > > have really been too cryptic for people to respond very well. > > > > I apologize for the cryptic nature (I didn't think I was being that > > cryptic but maybe I was) but this is a work related question so I need > > to be careful about how much I describe, I'm sure you can understand. > > It is a linear system except for a device at the input that prevents > > any DC and any positive voltages from entering. > > > > > You have not said if you want the frequency response of the system in
the
> > > general case or if you want the frequency response of the system to
the
> > > input signal. > > > > To the specific input signal. I want to know the system's response at > > a specified frequency. > > > a) Generate a frequency sweep. > b) Lowpass filter the output. > c) Plot the measured amplitude against the input frequencies. > voila! you have the frequency response. > > Unless we're all missing something...
Robert, I *think* he was saying that the input to the linear system isn't under direct control. That it is fixed in its nonsinusoidal form but that frequency and amplitude are under his control. So, if the output is lowpassed just above 2x the frequency of the sinusoid of the sweep (which is input pre-rectifier), then the output amplitude will be a measure of frequency response at the fundamental only. Sort of like applying "describing functions" in control systems analysis. How'd you propose to sweep the LP filter to do this? Fred
Fred Marshall wrote:

   ...
> > > Robert, > > I *think* he was saying that the input to the linear system isn't under > direct control. That it is fixed in its nonsinusoidal form but that > frequency and amplitude are under his control. So, if the output is > lowpassed just above 2x the frequency of the sinusoid of the sweep (which is > input pre-rectifier), then the output amplitude will be a measure of > frequency response at the fundamental only. Sort of like applying > "describing functions" in control systems analysis. How'd you propose to > sweep the LP filter to do this? > > Fred
It doesn't have to be low pass. Band pass will do. Think "lock-in amplifier." Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
In re-reading Ben's response, I see that the full-wave rectified sinusoid is
under your control.  What's not clear to me is if you have *chosen* to make
it a full-wave rectified sinusoid or if you have no control over it.  The
approach I described earlier will work if you have no control over it.
However, if you *do* have control over the waveform at that point, then a
classical approach with a sinusoidal input may be preferred because it
avoids having to do the Fourier Transform.   After having done that, you can
determine the output from any full-wave rectified sinusoid as before.

Hey Ben, we need to understand if we're even close here.  It's really not
likely that any of what we're talking about can be all that proprietary.
Anyway, pictures sometimes help.  Here are a couple:

This is what I understand the system setup to look like:

   +-----+      +-----------+      +-----------+
   |     | s1   | Full Wave | s2   | Linear    |  s3
   | cos +----->| Rectifier |----->| System/   |----->
   |     | f0/2 |    -1     |  f0  | Filter    |  f0
   +-----+      +-----------+ 2f0  +-----------+ 2f0
                              3f0                3f0
                              4f0                4f0
                              5f0                5f0
                               .                  .
This shows that a sinusoid (actually a cosine with positive peak at time=0)
going into a full wave rectifier which outputs an average negative voltage
as you've specified (thus the "-1" shown in the box).  In general, the
output will have sinusoidal components at f0 and all of its harmonics.  This
goes into the linear system.  In general, the output s3 will have all the
same sinusoidal components - but at differenct amplitudes and phases.

I understand that you can control the amplitude and frequency of cos=s1
where I've labeled the frequency to be f0/2 and have not shown the amplitude
on the diagram.
A question is, can you also control directly the form of s2 or not?

The approach I tried to suggest earlier worked like this:

In general, s1=A*cos(wt) where A is the peak amplitude and w is the radian
frequency and t is time.
Using the notation from the figure:
s1=A*cos(2*pi*f0/2*t)

from this, the general form for s2 is:
s2=A*[b0 + b1*cos(2*pi*f0/2*t) + phi1) + b2*cos(4*pi*f0/2*t + phi2) +
b3*cos(6*pi*f0/2*t + phi3) + .....]
where b0, b1, b2, ..... are the Fourier Series coefficients for the output
of a general nonlinear such as the full wave rectifier.

To be very specific, let's use the actual Fourier Series coefficients for a
perfect full-wave rectifier:

s2 = -A*[(2/pi)*(1 + (2/3)*cos(2*pi*f0/2*t) - (2/15)*cos(4*pi*f0/2*t) +
(2/35)*cos(6*pi*f0/2*t) - .....]

s2 = -A*[(2/pi)*(1 + (2/3)*cos(pi*f0*t) - (2/15)*cos(2*pi*f0*t) +
(2/35)*cos(3*pi*f0*t) - .....]

So, there is
- a dc term with value -A*2/pi,
- a fundamental sinusoid with amplitude -A*4/3*pi,
- a second harmonic with amplitude +4*A/15*pi,
- etc.
These are the Fourier Series Coefficients scaled by the input amplitude "A".

(I conveniently chose a cosine as input so that the entire Fourier Series
would be made up of cosines with no phase terms).

With this:

s3= -A*[(2/pi)*(c0*1 + c1*(2/3)*cos(pi*f0*t + phi1) -
c2*(2/15)*cos(2*pi*f0*t + phi2) + c3*(2/35)*cos(3*pi*f0*t + phi3) - .....]

where c0, c1, c2 etc. are the amplitude responses of the linear system at
dc, 1*f0, 2*f0, etc.
and where phi1 is the phase shift of the linear system at 1*f0, phi2 at
2*f0, etc.

The first method I suggested would have you calculate the Fourier Transform
of the output at f0, 2*f0, etc.
The Fourier Transform gives you the phase values directly - or at least to
an arbitrary phase reference if you haven't registered the output relative
to the input phase.
The Fourier Transform magnitudes allow you to calculate the magnitude
response of the linear system by dividing them by the input amplitudes in s2
which are the Foureir Series Coefficients scaled by the input amplitude "A"
given above.

So, if you compute the Fourier Transform of s3 at f0, let's say you get
magnitude 0.5 and phase pi/4.
Let's also say that the temporal epoch that you transformed was aligned to
start and end on peaks of the input sinusoid - so it looks like a cosine
input for phase alignment purposes.
Let's also say that the input peak amplitude A=1.0.

The input amplitude to the linear system is 4/3*pi and the output is 0.5.
So, the linear system amplitude response at f0 is 4/6*pi and the phase is
pi/4 - assuming that the rectifier introduces no phase shift or delay.

This calculation is repeated at each frequency 2*f0, 3*f0, etc.  giving you
the "frequency response" for a sinusoidal input at f0/2.

For each different value of f0, you get a list of amplitude and phase for
each of the harmonic frequencies.
Then, the process is repeated for each value of f0 of interest and you end
up with a table of input frequency vs. amplitude and phase for each harmonic
frequency number.

Now, this assumes that you only had control on s1 and not on s2.

If you do have control over s2, then the process can be different - although
I'm not sure if it's better.
It does avoid doing the Fourier Transform by doing a direct measurement.
You input a sinusoid as s2 for measurement purposes and measure magnitude
and phase of s3 and stick those results in a table for each frequency of
interest - being careful to include measurements at all of the harmonic
frequencies - actually in this case only the even harmonics and not even the
fundamental because of the form of the Fourier Series.
Then, you use those results the same as if you had calculated the Fourier
Transform of the output and use the same process as above to create a table
of input frequency vs. amplitude and phase for each harmonic frequency
number.

I do hope that you realize that there isn't one "frequency response" except
at a chosen harmonic - for example at f0 you can talk about a frequency
response as you vary f0.  However, there are also outputs at 2*f0, 3*f0,
etc. that have energy in them which you may or may not be interested in.  If
you are interested in them, then you might view the situation as multiple
frequency responses which apply to the "harmonic numbers".  That is, you
could plot the frequency response for f0 and another for 2*f0 and another
for 3*f0.  These could be superimposed on a plot against f0 as long as it's
clear that the scale for the response at 2*f0 is really compressed,
etc......

If the linear system is a perfect lowpass filter at 240Hz, then you might
end up with a plot that looks something like this:


amplitude ^ (not to scale)
  |                   |
  |  f0---------------------------------------+
  |                   |                       |
  |                                           |
  |  2*f0------------------+                  |
  |                   |    |                  |
  |                        |                  |
  |                        |                  |
  |                        |                  |
  |  3*f0--------+    |    |                  |
  |              |         |                  |
  |              |         |                  |
  |              |         |                  |
  +--------------|----|----|------------------|---------+

  0                  100  120                240         f0---->

The way this plot would be read is this:
Say the input sinusoid frequency is 50Hz
Then the rectifier output fundamental is 100Hz.
This plot says that the fundamental will have some appreciable amplitude
that can be read off the chart.
It says that the 2nd harmonic will have some appreciable amplitude that can
be read off the chart.
It says that the 3rd harmonic will *not* have appreciable amplitude.
Below f0=80Hz, the 3rd harmonic will show up.  80Hz=240/3
Above f0=120Hz, the 2nd harmonic will drop out. 120Hz=240/2
Above f0=240Hz, the fundamental will drop out.

Phase can be plotted similarly.

So, either this matches your situation and helps or it doesn't.  Does it???

Fred




"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<KLqdnfto6IKG-kqiRVn-iw@centurytel.net>...
> I *think* he was saying that the input to the linear system isn't under > direct control. That it is fixed in its nonsinusoidal form but that > frequency and amplitude are under his control. So, if the output is > lowpassed just above 2x the frequency of the sinusoid of the sweep (which is > input pre-rectifier), then the output amplitude will be a measure of > frequency response at the fundamental only. Sort of like applying > "describing functions" in control systems analysis. How'd you propose to > sweep the LP filter to do this? >
Hi Fred, I am sure the OP indicated that he can generate any stimulus frequency. He did indicate that there may be interference present, but Jerry's suggestion of using a BP filter that is matched to this stimulus frequency may be adequate. Of course if the input signal is close to the interference then there will be a problem. I wonder if the OP were to stimulate it with a unit impulse - in the direction that the rectifier would pass - and then do the FFT on the result. Because of the large influence an interfering tone can have on this method it might be prudent (if the interfence is changing) to do a number of these 'frequency response checks' and average the results Regards Robert