# Rectified FFT

Started by December 5, 2003
```
Fred Marshall wrote:
>
> "jim" <"N0sp"@m.sjedging@mwt.net> wrote in message
> news:3fd33220_7@corp.newsgroups.com...
> >
> >
> > Fred Marshall wrote:
> >
> > > Now, a rectifier is a pretty special thing because the output varies
> > > perfectly with the input amplitude.
> >
> > Is that true?  Well, assuming it is - his system frequency response could
> be
> > characterized as H1(f)+R(f)+H2(f). Where H1 and H2 are linear responses of
> the
> > system before and after the rectifier and R is the rectifier. The plus
> signs
> > indicate only how the system is arranged in time due to the nonlinearity
> of R.
> > If we assume the signal input is periodic and H2 has a flat response it
> would
> > seem possible to detect the period of the signal and de-rectify it to find
> H1.
> > If H1 is flat then feeding a rectified square wave thru the system would
> give
> > the step response of H2 and from that the impulse response could be
> derived.
> > If both H1 and H2 are substantially not flat in their response then it
> probably
> > gets a lot more complicated.
>
> Jim,
>
> What it gets is more than complicated.  It becomes impossible.  Here's why:
>
> First, it appears that you're assuming an arbitrary input.  That being the
> case, there is no way to predict what the cut off part of the waveform (the
> part the rectifier removes) may have looked like.  That's also the reason
> that H1 can't be derived with in a direct way.  In order to understand the
> output given an input, you would have to:
> 1) Define the input.
> 2) Define the output of H1 in the time domain.
> 3) Rectify the result.
> 4) convert to the frequency domain
> 5) multiply by H2 in frequency or convolve in time with h1(t).
>
> Step 3 isn't a 1 to 1 mapping or conversion.  There are many outputs of H1
> (and therefore, system inputs)  that can result in identical outputs from
> the rectifier, so you can't go back.
>
> Accordingly, I don't see any general way to find H1 given the output.
> One might state a special case as I did earlier - but that's about it.  No
> general case.
>
> Is it true that the amplitude of the ouput of a rectifier tracks the input
> amplitude if the input is a sinusoid and the rectifier is perfect?  Yes.
> That was the context of the discussion.  Note that "a sinusoid" doesn't have
> a dc offset - otherwise it would be something else.  So, if the input is
> arbitrary, then no.

It sounded like the Original poster was free to input whatever signal he wanted
and measure the output. So the DC offset is not an issue since the test
signal(s) could have no DC component.
Your original analysis assumed that only H2 existed - that is, the signal
remained on-modified prior to being rectified. If that were the case the problem
would be fairly simple since for any periodic signal the output of the rectifier
can be predicted/calculated. Therefore you would have the input and output of
the part of the system with response H2.

-jim

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 100,000 Newsgroups - 19 Different Servers! =-----
```
```"jim" <"N0sp"@m.sjedging@mwt.net> wrote in message
news:3fd3889e_3@corp.newsgroups.com...
>
>
> Fred Marshall wrote:
> >
> > "jim" <"N0sp"@m.sjedging@mwt.net> wrote in message
> > news:3fd33220_7@corp.newsgroups.com...
> > >
> > >
> > > Fred Marshall wrote:
> > >
> > > > Now, a rectifier is a pretty special thing because the output varies
> > > > perfectly with the input amplitude.
> > >
> > > Is that true?  Well, assuming it is - his system frequency response
could
> > be
> > > characterized as H1(f)+R(f)+H2(f). Where H1 and H2 are linear
responses of
> > the
> > > system before and after the rectifier and R is the rectifier. The plus
> > signs
> > > indicate only how the system is arranged in time due to the
nonlinearity
> > of R.
> > > If we assume the signal input is periodic and H2 has a flat response
it
> > would
> > > seem possible to detect the period of the signal and de-rectify it to
find
> > H1.
> > > If H1 is flat then feeding a rectified square wave thru the system
would
> > give
> > > the step response of H2 and from that the impulse response could be
> > derived.
> > > If both H1 and H2 are substantially not flat in their response then it
> > probably
> > > gets a lot more complicated.
> >
> > Jim,
> >
> > What it gets is more than complicated.  It becomes impossible.  Here's
why:
> >
> > First, it appears that you're assuming an arbitrary input.  That being
the
> > case, there is no way to predict what the cut off part of the waveform
(the
> > part the rectifier removes) may have looked like.  That's also the
reason
> > that H1 can't be derived with in a direct way.  In order to understand
the
> > output given an input, you would have to:
> > 1) Define the input.
> > 2) Define the output of H1 in the time domain.
> > 3) Rectify the result.
> > 4) convert to the frequency domain
> > 5) multiply by H2 in frequency or convolve in time with h1(t).
> >
> > Step 3 isn't a 1 to 1 mapping or conversion.  There are many outputs of
H1
> > (and therefore, system inputs)  that can result in identical outputs
from
> > the rectifier, so you can't go back.
> >
> > Accordingly, I don't see any general way to find H1 given the output.
> > One might state a special case as I did earlier - but that's about it.
No
> > general case.
> >
> > Is it true that the amplitude of the ouput of a rectifier tracks the
input
> > amplitude if the input is a sinusoid and the rectifier is perfect?  Yes.
> > That was the context of the discussion.  Note that "a sinusoid" doesn't
have
> > a dc offset - otherwise it would be something else.  So, if the input is
> > arbitrary, then no.
>
> It sounded like the Original poster was free to input whatever signal he
wanted
> and measure the output. So the DC offset is not an issue since the test
> signal(s) could have no DC component.
> Your original analysis assumed that only H2 existed - that is, the signal
> remained on-modified prior to being rectified. If that were the case the
problem
> would be fairly simple since for any periodic signal the output of the
rectifier
> can be predicted/calculated. Therefore you would have the input and output
of
> the part of the system with response H2.

Jim,

The original poster had a rectified sine wave - hardly general or arbitrary.
Had the test signals been general or arbitrary then a DC component at the
input would have been allowable wouldn't it?

My original *example* had only H2.  I chose not to include an H1 for the
reasons I gave earlier.
In this special case, the Fourier Series coefficients are unchanging - less
a scale factor and frequency indexing.  If you introduce a general H1, then
the Fourier Series coefficients out of the rectifier can be different for
every new signal amplitude and frequency even though the waveform stays the
same otherwise.

The whole point was to deal with an untractable situation - more or less as
the one posed - and to show that there are special cases where there are
ways to deal with them.  Your own special case could yield your own ways in
dealing with them.  It's still not clear what situation the OP really has.

Fred

```
```
Jerry Avins wrote:
>
> jim wrote:
>
> >
> > Fred Marshall wrote:
> >
> >
> >>Now, a rectifier is a pretty special thing because the output varies
> >>perfectly with the input amplitude.
> >
> >
> > Is that true?  Well, assuming it is - his system frequency response could be
> > characterized as H1(f)+R(f)+H2(f). Where H1 and H2 are linear responses of the
> > system before and after the rectifier and R is the rectifier. The plus signs
> > indicate only how the system is arranged in time due to the nonlinearity of R.
> >        If we assume the signal input is periodic and H2 has a flat response it would
> > seem possible to detect the period of the signal and de-rectify it to find H1.
> > If H1 is flat then feeding a rectified square wave thru the system would give
> > the step response of H2 and from that the impulse response could be derived.
> >       If both H1 and H2 are substantially not flat in their response then it probably
> > gets a lot more complicated.
> >
> > -jim
>
> Neither H1 nor H2 can be linear. Just as the rectifier produces DC
> from a single sinusoid, it produces intermodulation frequencies when
> more than one sinusoid is present. If you know enough about the
> original signal, there are deductions that can be made from the
> rectified output. If you only infer the original signal from the
> output, you can go far astray.

Yes, but the OP stated "I'm the one generating the signal" so I assume he could
know everything about the original signal and make it whatever he wants.

-jim

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 100,000 Newsgroups - 19 Different Servers! =-----
```
```"jim" <"N0sp"@m.sjedging@mwt.net> wrote in message
news:3fd3c419_1@corp.newsgroups.com...
>
>
> Jerry Avins wrote:
> >
> > jim wrote:
> >
> > >
> > > Fred Marshall wrote:
> > >
> > >
> > >>Now, a rectifier is a pretty special thing because the output varies
> > >>perfectly with the input amplitude.
> > >
> > >
> > > Is that true?  Well, assuming it is - his system frequency response
could be
> > > characterized as H1(f)+R(f)+H2(f). Where H1 and H2 are linear
responses of the
> > > system before and after the rectifier and R is the rectifier. The plus
signs
> > > indicate only how the system is arranged in time due to the
nonlinearity of R.
> > >        If we assume the signal input is periodic and H2 has a flat
response it would
> > > seem possible to detect the period of the signal and de-rectify it to
find H1.
> > > If H1 is flat then feeding a rectified square wave thru the system
would give
> > > the step response of H2 and from that the impulse response could be
derived.
> > >       If both H1 and H2 are substantially not flat in their response
then it probably
> > > gets a lot more complicated.
> > >
> > > -jim
> >
> > Neither H1 nor H2 can be linear. Just as the rectifier produces DC
> > from a single sinusoid, it produces intermodulation frequencies when
> > more than one sinusoid is present. If you know enough about the
> > original signal, there are deductions that can be made from the
> > rectified output. If you only infer the original signal from the
> > output, you can go far astray.
>
> Yes, but the OP stated "I'm the one generating the signal" so I assume he
could
> know everything about the original signal and make it whatever he wants.

If he's the one making the signal, and he already knows exactly what it is,
then why does he want to perform the FFT of the signal after it's been
through a rectifier and then try and work backwards to find out what the
original signal was.  He already knows what it was...

It makes more sense if the OP is trying to work out what an arbitrary signal
was after it's been through the rectifier by using an FFT and then somehow
massaging the data to get back the original signal.  And as has been said,
that's not really possible because the rectification isn't a linear process.
What's to distinguish the output of the rectifier with a sine wave input
from the output of the same rectifier with an already rectified sine wave
input.  There is no unique mapping back through the rectifier, and so no one
unique signal could be obtained as the result of the massaging.

```
```
Bevan Weiss wrote:

>
> If he's the one making the signal, and he already knows exactly what it is,
> then why does he want to perform the FFT of the signal after it's been
> through a rectifier and then try and work backwards to find out what the
> original signal was.  He already knows what it was...

Because if he can successfully do that for all signals containing any
frequencies of interest he will know the frequency response of the system for
the range of frequencies he's interested in.
I read that he has a black box. He can apply an input to it and get an out put.
Somehow he knows that there is a rectifier inside (probably cause the output is
rectified :}. But he suspects there is more than the rectifier. Hopefully, the
other components can be described as linear systems if they were isolated and
not in a circuit with a rectifier.
His problem: how to apply  input(s) and analyze the output and deduce the
frequency response of the linear components.
The first step would seem to be to try to determine by experiment if the other
components came before or after the rectifier. If the rectifier was the first or
last component in the circuit,  and that was known, the problem would seem to be
much simpler.

-jim

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 100,000 Newsgroups - 19 Different Servers! =-----
```
```"Bevan Weiss" <kaizen__@NOSPAMhotmail.com> wrote in message >
> If he's the one making the signal, and he already knows exactly what it is,
> then why does he want to perform the FFT of the signal after it's been
> through a rectifier and then try and work backwards to find out what the
> original signal was.  He already knows what it was...
>
> It makes more sense if the OP is trying to work out what an arbitrary signal
> was after it's been through the rectifier by using an FFT and then somehow
> massaging the data to get back the original signal.  And as has been said,
> that's not really possible because the rectification isn't a linear process.
> What's to distinguish the output of the rectifier with a sine wave input
> from the output of the same rectifier with an already rectified sine wave
> input.  There is no unique mapping back through the rectifier, and so no one
> unique signal could be obtained as the result of the massaging.

Wow, I didn't realize one question could generate such a discussion!
To clarify, as I said before I'm trying to classify the frequency
response of a system (not under my control) that I can only get a
rectified signal through. I am the one generating the rectified input
signal to the system and I am the one measuring the output signal from
was extraordinarly difficult problem given the fact that I cannot
guarantee that there won't be another signal present in the system
besides my own.

Thanks for everyone's input.

Ben
```
```On Mon, 8 Dec 2003, Benjamin M. Stocks wrote:

> Wow, I didn't realize one question could generate such a discussion!
> To clarify, as I said before I'm trying to classify the frequency
> response of a system (not under my control) that I can only get a
> rectified signal through. I am the one generating the rectified input
> signal to the system and I am the one measuring the output signal from
> was extraordinarly difficult problem given the fact that I cannot
> guarantee that there won't be another signal present in the system
> besides my own.

Is the rectification only before the signal enters the linear part of the
system? If so:

Just add a DC bias to your test signal to dodge the nonlinearity. If that
won't help for some reason (the interfering signals or you can't use DC)
try sending in a logarithmic sine sweep. Deconvolving it to an impulse
response will yield the generated harmonics as separate impulse responses
so you can easily extract the fundamental.

-olli
```
```"Benjamin M. Stocks" <stocksb@ieee.org> wrote in message
> "Bevan Weiss" <kaizen__@NOSPAMhotmail.com> wrote in message >
> > If he's the one making the signal, and he already knows exactly what it
is,
> > then why does he want to perform the FFT of the signal after it's been
> > through a rectifier and then try and work backwards to find out what the
> > original signal was.  He already knows what it was...
> >
> > It makes more sense if the OP is trying to work out what an arbitrary
signal
> > was after it's been through the rectifier by using an FFT and then
somehow
> > massaging the data to get back the original signal.  And as has been
said,
> > that's not really possible because the rectification isn't a linear
process.
> > What's to distinguish the output of the rectifier with a sine wave input
> > from the output of the same rectifier with an already rectified sine
wave
> > input.  There is no unique mapping back through the rectifier, and so no
one
> > unique signal could be obtained as the result of the massaging.
>
> Wow, I didn't realize one question could generate such a discussion!
> To clarify, as I said before I'm trying to classify the frequency
> response of a system (not under my control) that I can only get a
> rectified signal through. I am the one generating the rectified input
> signal to the system and I am the one measuring the output signal from
> was extraordinarly difficult problem given the fact that I cannot
> guarantee that there won't be another signal present in the system
> besides my own.

Ben,

You need to be more clear about the situation.  This message suggests things
for the first time unless I missed it.  e.g.
>I can only get a
> rectified signal through. I am the one generating the rectified input
> signal to the system and I am the one measuring the output signal from
> the system.

This makes it sound like it could be a linear system with a "rectified
input".
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.

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.

If the system is linear and if you input a full-wave rectified sinusoid then
you can do this:
0) You must know the frequency and amplitude of the full-wave rectified
sinusoid
1) Represent the full-wave rectified sinusoid as a Fourier Series.
2) Assuming a reasonably long sample of the output, Fourier Transform the
output with this special input present.
3) Sample the Fourier Transform at the frequencies represented in the
Fourier Series you calculated in (1) for those frequencies where the Fourier
Series coefficients of (1) are not zero.
The frequency response is the ratio of the Fourier Transform sample divided
by the Fourier Series coefficient I do believe.  In other words, you need to
know how the linear system modifies each of the frequencies that you've
input - in amplitude and phase.

You can't use this limited input signal to determine the general frequency
response of the system - simply because there aren't all frequencies present
at the input.  That's why impulse responses or unit sample responses are
useful.

If there are other signals present at the same time then there could be ways
to handl that:

1) if the other signals are stationary and don't occupy the same frequencies
as the terms in the Fourier Series - then the measurement above is pretty
much undisturbed (as long as the sample length is long and perhaps some
windowing is done to reduce spectral leakage).
2) if the other signals sometimes don't occupy the same frequencies as the
terms in the Fourier Series then you may need to do a number of measurements
and take the averages at each frequency as an estimate.  You can't use the
minima because the other signals could destructively add.  Maybe turning
your input on and off periodically would be helpful in determining when it
is unperturbed at any particular frequency - still keeping the ON time and
OFF time as suitably long sample times - obviously there's a tradeoff here
that may not allow this to work.

Fred

```
```"Olli Niemitalo" <o@iki.fi> wrote in message
news:Pine.GSO.4.58.0312081626180.5531@paju.oulu.fi...
> On Mon, 8 Dec 2003, Benjamin M. Stocks wrote:
>
> > Wow, I didn't realize one question could generate such a discussion!
> > To clarify, as I said before I'm trying to classify the frequency
> > response of a system (not under my control) that I can only get a
> > rectified signal through. I am the one generating the rectified input
> > signal to the system and I am the one measuring the output signal from
> > was extraordinarly difficult problem given the fact that I cannot
> > guarantee that there won't be another signal present in the system
> > besides my own.
>
> Is the rectification only before the signal enters the linear part of the
> system? If so:
>
> Just add a DC bias to your test signal to dodge the nonlinearity. If that
> won't help for some reason (the interfering signals or you can't use DC)
> try sending in a logarithmic sine sweep. Deconvolving it to an impulse
> response will yield the generated harmonics as separate impulse responses
> so you can easily extract the fundamental.

I agree that adding some DC bias to the input signal (to ensure it remains
positive at all times, hence avoiding the nonlinearity of the rectifier) is
the best method.  Then assuming the remaining circuitry is linear, you could
use superposition to remove the effect of the DC bias, simply by subtracting
the DC response from the response of the DC biased AC signal.  That will
leave you with just the remaining circuitries response, ie it will ignore
the rectification circuit.

```
```
"Benjamin M. Stocks" wrote:

> > Nope. A rectified sinusoid is equivalent to introducing distortions into
> > your signal. An FFT of that will essentially show all the distortions. I
> > can't think of a way undo that after the FFT.
>
> What if I knew the frequency of the non-rectified signal (I'm the one
> generating the signal) is there a time or frequency domain
> manipulation I can do to produce an FFT? Basically there's a system I
> can only get a rectified signal through and I want to measure its
> frequency response.
>
> The more I think about it the less I think this is possible to do with
> an FFT but it was the first thing to come to mind.

Can you manage an AM waveform and vary the baseband freq?

Tom

```