FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > DSP

DSP comp.dsp newsgroup, mailing list

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-07-2009, 01:38 PM
Eugen Artus
Guest
 
Posts: n/a
Default Modelling of a RC series connection in time and frequency domain

Hi!

Suppose there is resistor R and a capacitor C connected in series. A voltage
U_0 is applied at time t=0. The current in the time domain is then

I(t) = U_0/R * e^(-t/RC) (1)

Taking a Laplace transform and substituting s by j*2*\pi*f, I get the
frequency domain current:

I(f) = U_0*C/(j*2*\pi*f*R*C+1) (2)

Now the problem: I defined values for U_0, R and C, calculated the time
domain signal by Eq. 1 and transformed it by DFT (using the Python function
numpy.fft.rfft). Then, I normalized the result by multiplying with 2/N,
except the first and the last sample, which were multiplied with 1/N.
N is the number of samples of the time signal.

A comparison with the signal predicted by Eq. 2 shows a significant
difference. What am I doing wrong?

Many thanks!

Eugen

Reply With Quote
  #2 (permalink)  
Old 09-07-2009, 02:00 PM
Rune Allnor
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

On 7 Sep, 13:38, Eugen Artus <eugen.ar...@arcor.de> wrote:
> Hi!
>
> Suppose there is resistor R and a capacitor C connected in series. A voltage
> U_0 is applied at time t=0. The current in the time domain is then
>
> I(t) = U_0/R * e^(-t/RC) * * * * * * * *(1)
>
> Taking a Laplace transform and substituting s by j*2*\pi*f, I get the
> frequency domain current:
>
> I(f) = U_0*C/(j*2*\pi*f*R*C+1) * * * * *(2)
>
> Now the problem: I defined values for U_0, R and C, calculated the time
> domain signal by Eq. 1 and transformed it by DFT (using the Python function
> numpy.fft.rfft). Then, I normalized the result by multiplying with 2/N,
> except the first and the last sample, which were multiplied with 1/N.
> N is the number of samples of the time signal.
>
> A comparison with the signal predicted by Eq. 2 shows a significant
> difference. What am I doing wrong?


The error you make is that you think that the DFT and the
Fourier Transform are the seame operation. In fact, they are
fundamentally different:

- The FT works with infinitely long, continuous-time signals.
- The DFT works with dicrete-time data of finite length.

These differences have a couple of consequences, like

- The DFT produces a discrete, finite-length spectrum
- The FT produces a continuous, infinitely wide spectrum

The FT and the DFT can be linked, but then you have to
apply the sampling theorem, map the frequency response
of the RC cirquit to Z-transform domain by using a
BiLinear Transform (BLT), and so on.

Rune
Reply With Quote
  #3 (permalink)  
Old 09-07-2009, 03:13 PM
julius
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

On Sep 7, 8:00*am, Rune Allnor <all...@tele.ntnu.no> wrote:
> On 7 Sep, 13:38, Eugen Artus <eugen.ar...@arcor.de> wrote:
>
>
>
> > Hi!

>
> > Suppose there is resistor R and a capacitor C connected in series. A voltage
> > U_0 is applied at time t=0. The current in the time domain is then

>
> > I(t) = U_0/R * e^(-t/RC) * * * * * * * *(1)

>
> > Taking a Laplace transform and substituting s by j*2*\pi*f, I get the
> > frequency domain current:

>
> > I(f) = U_0*C/(j*2*\pi*f*R*C+1) * * * * *(2)

>
> > Now the problem: I defined values for U_0, R and C, calculated the time
> > domain signal by Eq. 1 and transformed it by DFT (using the Python function
> > numpy.fft.rfft). Then, I normalized the result by multiplying with 2/N,
> > except the first and the last sample, which were multiplied with 1/N.
> > N is the number of samples of the time signal.

>
> > A comparison with the signal predicted by Eq. 2 shows a significant
> > difference. What am I doing wrong?

>
> The error you make is that you think that the DFT and the
> Fourier Transform are the seame operation. In fact, they are
> fundamentally different:
>
> - The FT works with infinitely long, continuous-time signals.
> - The DFT works with dicrete-time data of finite length.
>
> These differences have a couple of consequences, like
>
> - The DFT produces a discrete, finite-length spectrum
> - The FT produces a continuous, infinitely wide spectrum
>
> The FT and the DFT can be linked, but then you have to
> apply the sampling theorem, map the frequency response
> of the RC cirquit to Z-transform domain by using a
> BiLinear Transform (BLT), and so on.
>
> Rune


To add to Rune's comment, the DFT operates on discrete,
finite, PERIODIC time series and produces a discrete, finite,
PERIODIC frequency series.

One way to get around this is to use zero padding judiciously.

Julius
Reply With Quote
  #4 (permalink)  
Old 09-07-2009, 05:30 PM
Rune Allnor
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

On 7 Sep, 15:13, julius <juli...@gmail.com> wrote:
> On Sep 7, 8:00*am, Rune Allnor <all...@tele.ntnu.no> wrote:
>
>
>
>
>
> > On 7 Sep, 13:38, Eugen Artus <eugen.ar...@arcor.de> wrote:

>
> > > Hi!

>
> > > Suppose there is resistor R and a capacitor C connected in series. A voltage
> > > U_0 is applied at time t=0. The current in the time domain is then

>
> > > I(t) = U_0/R * e^(-t/RC) * * * * * * * *(1)

>
> > > Taking a Laplace transform and substituting s by j*2*\pi*f, I get the
> > > frequency domain current:

>
> > > I(f) = U_0*C/(j*2*\pi*f*R*C+1) * * * * *(2)

>
> > > Now the problem: I defined values for U_0, R and C, calculated the time
> > > domain signal by Eq. 1 and transformed it by DFT (using the Python function
> > > numpy.fft.rfft). Then, I normalized the result by multiplying with 2/N,
> > > except the first and the last sample, which were multiplied with 1/N.
> > > N is the number of samples of the time signal.

>
> > > A comparison with the signal predicted by Eq. 2 shows a significant
> > > difference. What am I doing wrong?

>
> > The error you make is that you think that the DFT and the
> > Fourier Transform are the seame operation. In fact, they are
> > fundamentally different:

>
> > - The FT works with infinitely long, continuous-time signals.
> > - The DFT works with dicrete-time data of finite length.

>
> > These differences have a couple of consequences, like

>
> > - The DFT produces a discrete, finite-length spectrum
> > - The FT produces a continuous, infinitely wide spectrum

>
> > The FT and the DFT can be linked, but then you have to
> > apply the sampling theorem, map the frequency response
> > of the RC cirquit to Z-transform domain by using a
> > BiLinear Transform (BLT), and so on.

>
> > Rune

>
> To add to Rune's comment, the DFT operates on discrete,
> finite, PERIODIC time series and produces a discrete, finite,
> PERIODIC frequency series.
>
> One way to get around this is to use zero padding judiciously.


Ah. Here are some data I have lying around:

x = [1,2,3,4,5,6,7,8,9];

Those numbers are all there is to this data set.
No more. No less.

Remind me, where is that period?

Rune
Reply With Quote
  #5 (permalink)  
Old 09-07-2009, 05:35 PM
Jerry Avins
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

Rune Allnor wrote:
> On 7 Sep, 15:13, julius <juli...@gmail.com> wrote:
>> On Sep 7, 8:00 am, Rune Allnor <all...@tele.ntnu.no> wrote:
>>
>>
>>
>>
>>
>>> On 7 Sep, 13:38, Eugen Artus <eugen.ar...@arcor.de> wrote:
>>>> Hi!
>>>> Suppose there is resistor R and a capacitor C connected in series. A voltage
>>>> U_0 is applied at time t=0. The current in the time domain is then
>>>> I(t) = U_0/R * e^(-t/RC) (1)
>>>> Taking a Laplace transform and substituting s by j*2*\pi*f, I get the
>>>> frequency domain current:
>>>> I(f) = U_0*C/(j*2*\pi*f*R*C+1) (2)
>>>> Now the problem: I defined values for U_0, R and C, calculated the time
>>>> domain signal by Eq. 1 and transformed it by DFT (using the Python function
>>>> numpy.fft.rfft). Then, I normalized the result by multiplying with 2/N,
>>>> except the first and the last sample, which were multiplied with 1/N.
>>>> N is the number of samples of the time signal.
>>>> A comparison with the signal predicted by Eq. 2 shows a significant
>>>> difference. What am I doing wrong?
>>> The error you make is that you think that the DFT and the
>>> Fourier Transform are the seame operation. In fact, they are
>>> fundamentally different:
>>> - The FT works with infinitely long, continuous-time signals.
>>> - The DFT works with dicrete-time data of finite length.
>>> These differences have a couple of consequences, like
>>> - The DFT produces a discrete, finite-length spectrum
>>> - The FT produces a continuous, infinitely wide spectrum
>>> The FT and the DFT can be linked, but then you have to
>>> apply the sampling theorem, map the frequency response
>>> of the RC cirquit to Z-transform domain by using a
>>> BiLinear Transform (BLT), and so on.
>>> Rune

>> To add to Rune's comment, the DFT operates on discrete,
>> finite, PERIODIC time series and produces a discrete, finite,
>> PERIODIC frequency series.
>>
>> One way to get around this is to use zero padding judiciously.

>
> Ah. Here are some data I have lying around:
>
> x = [1,2,3,4,5,6,7,8,9];
>
> Those numbers are all there is to this data set.
> No more. No less.
>
> Remind me, where is that period?


The period is not associated with the numbers, but rather with what the
FFT does. The result of performing an FFT on your data is exactly the
same as performing one on ...1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,....

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #6 (permalink)  
Old 09-07-2009, 05:36 PM
Tim Wescott
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequencydomain

On Mon, 07 Sep 2009 08:30:10 -0700, Rune Allnor wrote:

> On 7 Sep, 15:13, julius <juli...@gmail.com> wrote:
>> On Sep 7, 8:00Â*am, Rune Allnor <all...@tele.ntnu.no> wrote:
>>
>>
>>
>>
>>
>> > On 7 Sep, 13:38, Eugen Artus <eugen.ar...@arcor.de> wrote:

>>
>> > > Hi!

>>
>> > > Suppose there is resistor R and a capacitor C connected in series.
>> > > A voltage U_0 is applied at time t=0. The current in the time
>> > > domain is then

>>
>> > > I(t) = U_0/R * e^(-t/RC) Â* Â* Â* Â* Â* Â* Â* Â*(1)

>>
>> > > Taking a Laplace transform and substituting s by j*2*\pi*f, I get
>> > > the frequency domain current:

>>
>> > > I(f) = U_0*C/(j*2*\pi*f*R*C+1) Â* Â* Â* Â* Â*(2)

>>
>> > > Now the problem: I defined values for U_0, R and C, calculated the
>> > > time domain signal by Eq. 1 and transformed it by DFT (using the
>> > > Python function numpy.fft.rfft). Then, I normalized the result by
>> > > multiplying with 2/N, except the first and the last sample, which
>> > > were multiplied with 1/N. N is the number of samples of the time
>> > > signal.

>>
>> > > A comparison with the signal predicted by Eq. 2 shows a significant
>> > > difference. What am I doing wrong?

>>
>> > The error you make is that you think that the DFT and the Fourier
>> > Transform are the seame operation. In fact, they are fundamentally
>> > different:

>>
>> > - The FT works with infinitely long, continuous-time signals. - The
>> > DFT works with dicrete-time data of finite length.

>>
>> > These differences have a couple of consequences, like

>>
>> > - The DFT produces a discrete, finite-length spectrum - The FT
>> > produces a continuous, infinitely wide spectrum

>>
>> > The FT and the DFT can be linked, but then you have to apply the
>> > sampling theorem, map the frequency response of the RC cirquit to
>> > Z-transform domain by using a BiLinear Transform (BLT), and so on.

>>
>> > Rune

>>
>> To add to Rune's comment, the DFT operates on discrete, finite,
>> PERIODIC time series and produces a discrete, finite, PERIODIC
>> frequency series.
>>
>> One way to get around this is to use zero padding judiciously.

>
> Ah. Here are some data I have lying around:
>
> x = [1,2,3,4,5,6,7,8,9];
>
> Those numbers are all there is to this data set. No more. No less.
>
> Remind me, where is that period?


No where. Which is why you should use the DFT judiciously on this
sequence, because the DFT implicitly assumes a periodic, evenly sampled
sequence and your sequence is not periodic.

--
www.wescottdesign.com
Reply With Quote
  #7 (permalink)  
Old 09-07-2009, 06:48 PM
Rune Allnor
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

On 7 Sep, 17:36, Tim Wescott <t...@seemywebsite.com> wrote:
> On Mon, 07 Sep 2009 08:30:10 -0700, Rune Allnor wrote:
> > On 7 Sep, 15:13, julius <juli...@gmail.com> wrote:
> >> On Sep 7, 8:00*am, Rune Allnor <all...@tele.ntnu.no> wrote:

>
> >> > On 7 Sep, 13:38, Eugen Artus <eugen.ar...@arcor.de> wrote:

>
> >> > > Hi!

>
> >> > > Suppose there is resistor R and a capacitor C connected in series.
> >> > > A voltage U_0 is applied at time t=0. The current in the time
> >> > > domain is then

>
> >> > > I(t) = U_0/R * e^(-t/RC) * * * * * * * *(1)

>
> >> > > Taking a Laplace transform and substituting s by j*2*\pi*f, I get
> >> > > the frequency domain current:

>
> >> > > I(f) = U_0*C/(j*2*\pi*f*R*C+1) * * * * *(2)

>
> >> > > Now the problem: I defined values for U_0, R and C, calculated the
> >> > > time domain signal by Eq. 1 and transformed it by DFT (using the
> >> > > Python function numpy.fft.rfft). Then, I normalized the result by
> >> > > multiplying with 2/N, except the first and the last sample, which
> >> > > were multiplied with 1/N. N is the number of samples of the time
> >> > > signal.

>
> >> > > A comparison with the signal predicted by Eq. 2 shows a significant
> >> > > difference. What am I doing wrong?

>
> >> > The error you make is that you think that the DFT and the Fourier
> >> > Transform are the seame operation. In fact, they are fundamentally
> >> > different:

>
> >> > - The FT works with infinitely long, continuous-time signals. - The
> >> > DFT works with dicrete-time data of finite length.

>
> >> > These differences have a couple of consequences, like

>
> >> > - The DFT produces a discrete, finite-length spectrum - The FT
> >> > produces a continuous, infinitely wide spectrum

>
> >> > The FT and the DFT can be linked, but then you have to apply the
> >> > sampling theorem, map the frequency response of the RC cirquit to
> >> > Z-transform domain by using a BiLinear Transform (BLT), and so on.

>
> >> > Rune

>
> >> To add to Rune's comment, the DFT operates on discrete, finite,
> >> PERIODIC time series and produces a discrete, finite, PERIODIC
> >> frequency series.

>
> >> One way to get around this is to use zero padding judiciously.

>
> > Ah. Here are some data I have lying around:

>
> > x = [1,2,3,4,5,6,7,8,9];

>
> > Those numbers are all there is to this data set. No more. No less.

>
> > Remind me, where is that period?

>
> No where. *Which is why you should use the DFT judiciously on this
> sequence, because the DFT implicitly assumes a periodic, evenly sampled
> sequence and your sequence is not periodic.


.... so you seem to mean that the DFT can not be used on
this sequence? If so, what does the numbers

X = fft(x) =
[ 45.0000
-4.5000 +12.3636i
-4.5000 + 5.3629i
-4.5000 + 2.5981i
-4.5000 + 0.7935i
-4.5000 - 0.7935i
-4.5000 - 2.5981i
-4.5000 - 5.3629i
-4.5000 -12.3636i]

signify?

Rune
Reply With Quote
  #8 (permalink)  
Old 09-07-2009, 06:55 PM
Tim Wescott
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequencydomain

On Mon, 07 Sep 2009 11:35:23 -0400, Jerry Avins wrote:

> Rune Allnor wrote:
>> On 7 Sep, 15:13, julius <juli...@gmail.com> wrote:
>>> On Sep 7, 8:00 am, Rune Allnor <all...@tele.ntnu.no> wrote:
>>>
>>>
>>>
>>>
>>>
>>>> On 7 Sep, 13:38, Eugen Artus <eugen.ar...@arcor.de> wrote:
>>>>> Hi!
>>>>> Suppose there is resistor R and a capacitor C connected in series. A
>>>>> voltage U_0 is applied at time t=0. The current in the time domain
>>>>> is then I(t) = U_0/R * e^(-t/RC) (1) Taking a Laplace
>>>>> transform and substituting s by j*2*\pi*f, I get the frequency
>>>>> domain current:
>>>>> I(f) = U_0*C/(j*2*\pi*f*R*C+1) (2) Now the problem: I
>>>>> defined values for U_0, R and C, calculated the time domain signal
>>>>> by Eq. 1 and transformed it by DFT (using the Python function
>>>>> numpy.fft.rfft). Then, I normalized the result by multiplying with
>>>>> 2/N, except the first and the last sample, which were multiplied
>>>>> with 1/N. N is the number of samples of the time signal. A
>>>>> comparison with the signal predicted by Eq. 2 shows a significant
>>>>> difference. What am I doing wrong?
>>>> The error you make is that you think that the DFT and the Fourier
>>>> Transform are the seame operation. In fact, they are fundamentally
>>>> different:
>>>> - The FT works with infinitely long, continuous-time signals. - The
>>>> DFT works with dicrete-time data of finite length. These differences
>>>> have a couple of consequences, like - The DFT produces a discrete,
>>>> finite-length spectrum - The FT produces a continuous, infinitely
>>>> wide spectrum The FT and the DFT can be linked, but then you have to
>>>> apply the sampling theorem, map the frequency response of the RC
>>>> cirquit to Z-transform domain by using a BiLinear Transform (BLT),
>>>> and so on.
>>>> Rune
>>> To add to Rune's comment, the DFT operates on discrete, finite,
>>> PERIODIC time series and produces a discrete, finite, PERIODIC
>>> frequency series.
>>>
>>> One way to get around this is to use zero padding judiciously.

>>
>> Ah. Here are some data I have lying around:
>>
>> x = [1,2,3,4,5,6,7,8,9];
>>
>> Those numbers are all there is to this data set. No more. No less.
>>
>> Remind me, where is that period?

>
> The period is not associated with the numbers, but rather with what the
> FFT does. The result of performing an FFT on your data is exactly the
> same as performing one on ...1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,....


After I wrote my response, I realized that one doesn't have to insist on
periodicity -- one can insist, instead, on data that lives on a 1-sphere
(i.e. a circle). Then the periodicity becomes an illusion generated by
our insistence on data existing on a line.

The two are mathematically equivalent, of course; only how one thinks
about one or the other is different between the two cases. The
_important_ thing is that -- to the DFT -- if you have a sequence [x0,
x1, ... , x{n-1}] then x{n-1} is exactly as adjacent to x0 x1 is. Thus
if you use the DFT to analyze a sequence of numbers that are all there is
in the data set, no more, then you need to either make sure that the data
set is circular to match the DFT, or you have to do whatever is necessary
to insure that the approximation to the DFT input is valid.

--
www.wescottdesign.com
Reply With Quote
  #9 (permalink)  
Old 09-07-2009, 07:34 PM
Rune Allnor
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

On 7 Sep, 18:55, Tim Wescott <t...@seemywebsite.com> wrote:
> On Mon, 07 Sep 2009 11:35:23 -0400, Jerry Avins wrote:
> > Rune Allnor wrote:
> >> On 7 Sep, 15:13, julius <juli...@gmail.com> wrote:
> >>> On Sep 7, 8:00 am, Rune Allnor <all...@tele.ntnu.no> wrote:

>
> >>>> On 7 Sep, 13:38, Eugen Artus <eugen.ar...@arcor.de> wrote:
> >>>>> Hi!
> >>>>> Suppose there is resistor R and a capacitor C connected in series. A
> >>>>> voltage U_0 is applied at time t=0. The current in the time domain
> >>>>> is then I(t) = U_0/R * e^(-t/RC) * * * * * * * *(1) Taking a Laplace
> >>>>> transform and substituting s by j*2*\pi*f, I get the frequency
> >>>>> domain current:
> >>>>> I(f) = U_0*C/(j*2*\pi*f*R*C+1) * * * * *(2) Now the problem: I
> >>>>> defined values for U_0, R and C, calculated the time domain signal
> >>>>> by Eq. 1 and transformed it by DFT (using the Python function
> >>>>> numpy.fft.rfft). Then, I normalized the result by multiplying with
> >>>>> 2/N, except the first and the last sample, which were multiplied
> >>>>> with 1/N. N is the number of samples of the time signal. A
> >>>>> comparison with the signal predicted by Eq. 2 shows a significant
> >>>>> difference. What am I doing wrong?
> >>>> The error you make is that you think that the DFT and the Fourier
> >>>> Transform are the seame operation. In fact, they are fundamentally
> >>>> different:
> >>>> - The FT works with infinitely long, continuous-time signals. - The
> >>>> DFT works with dicrete-time data of finite length. These differences
> >>>> have a couple of consequences, like - The DFT produces a discrete,
> >>>> finite-length spectrum - The FT produces a continuous, infinitely
> >>>> wide spectrum The FT and the DFT can be linked, but then you have to
> >>>> apply the sampling theorem, map the frequency response of the RC
> >>>> cirquit to Z-transform domain by using a BiLinear Transform (BLT),
> >>>> and so on.
> >>>> Rune
> >>> To add to Rune's comment, the DFT operates on discrete, finite,
> >>> PERIODIC time series and produces a discrete, finite, PERIODIC
> >>> frequency series.

>
> >>> One way to get around this is to use zero padding judiciously.

>
> >> Ah. Here are some data I have lying around:

>
> >> x = [1,2,3,4,5,6,7,8,9];

>
> >> Those numbers are all there is to this data set. No more. No less.

>
> >> Remind me, where is that period?

>
> > The period is not associated with the numbers, but rather with what the
> > FFT does. The result of performing an FFT on your data is exactly the
> > same as performing one on ...1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,....

>
> After I wrote my response, I realized that one doesn't have to insist on
> periodicity -- one can insist, instead, on data that lives on a 1-sphere
> (i.e. a circle). *Then the periodicity becomes an illusion generated by
> our insistence on data existing on a line.


Very good. Not perfect, but a lot better than most of the
sheep who make their opinions known here.

Of course, once you think a little bit more about this, you
realize that your argument is the usual relation between the
DFT and ZT, just applied in reverse. Usually one starts out
with the ZT (which uses the rectangular form of complex numbers)
and argue that it is related to the DFT, which represents the
unit circle on polar form. In that case the 'periodicity'
of the DFT becomes an illusion caused by the ambiguity
of the polar representation of complex numbers.

If you think a little bit more about this, you will no
doubt discover that even the complex plane is irrelevant,
as the DFT only maps an N-length complex-valued vector
to a different set of basis vectors.

Rune
Reply With Quote
  #10 (permalink)  
Old 09-07-2009, 07:44 PM
Tim Wescott
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequencydomain

On Mon, 07 Sep 2009 09:48:56 -0700, Rune Allnor wrote:

> On 7 Sep, 17:36, Tim Wescott <t...@seemywebsite.com> wrote:
>> On Mon, 07 Sep 2009 08:30:10 -0700, Rune Allnor wrote:
>> > On 7 Sep, 15:13, julius <juli...@gmail.com> wrote:
>> >> On Sep 7, 8:00Â*am, Rune Allnor <all...@tele.ntnu.no> wrote:

>>
>> >> > On 7 Sep, 13:38, Eugen Artus <eugen.ar...@arcor.de> wrote:

>>
>> >> > > Hi!

>>
>> >> > > Suppose there is resistor R and a capacitor C connected in
>> >> > > series. A voltage U_0 is applied at time t=0. The current in the
>> >> > > time domain is then

>>
>> >> > > I(t) = U_0/R * e^(-t/RC) Â* Â* Â* Â* Â* Â* Â* Â*(1)

>>
>> >> > > Taking a Laplace transform and substituting s by j*2*\pi*f, I
>> >> > > get the frequency domain current:

>>
>> >> > > I(f) = U_0*C/(j*2*\pi*f*R*C+1) Â* Â* Â* Â* Â*(2)

>>
>> >> > > Now the problem: I defined values for U_0, R and C, calculated
>> >> > > the time domain signal by Eq. 1 and transformed it by DFT (using
>> >> > > the Python function numpy.fft.rfft). Then, I normalized the
>> >> > > result by multiplying with 2/N, except the first and the last
>> >> > > sample, which were multiplied with 1/N. N is the number of
>> >> > > samples of the time signal.

>>
>> >> > > A comparison with the signal predicted by Eq. 2 shows a
>> >> > > significant difference. What am I doing wrong?

>>
>> >> > The error you make is that you think that the DFT and the Fourier
>> >> > Transform are the seame operation. In fact, they are fundamentally
>> >> > different:

>>
>> >> > - The FT works with infinitely long, continuous-time signals. -
>> >> > The DFT works with dicrete-time data of finite length.

>>
>> >> > These differences have a couple of consequences, like

>>
>> >> > - The DFT produces a discrete, finite-length spectrum - The FT
>> >> > produces a continuous, infinitely wide spectrum

>>
>> >> > The FT and the DFT can be linked, but then you have to apply the
>> >> > sampling theorem, map the frequency response of the RC cirquit to
>> >> > Z-transform domain by using a BiLinear Transform (BLT), and so on.

>>
>> >> > Rune

>>
>> >> To add to Rune's comment, the DFT operates on discrete, finite,
>> >> PERIODIC time series and produces a discrete, finite, PERIODIC
>> >> frequency series.

>>
>> >> One way to get around this is to use zero padding judiciously.

>>
>> > Ah. Here are some data I have lying around:

>>
>> > x = [1,2,3,4,5,6,7,8,9];

>>
>> > Those numbers are all there is to this data set. No more. No less.

>>
>> > Remind me, where is that period?

>>
>> No where. Â*Which is why you should use the DFT judiciously on this
>> sequence, because the DFT implicitly assumes a periodic, evenly sampled
>> sequence and your sequence is not periodic.

>
> ... so you seem to mean that the DFT can not be used on this sequence?
> If so, what does the numbers
>
> X = fft(x) =
> [ 45.0000
> -4.5000 +12.3636i
> -4.5000 + 5.3629i
> -4.5000 + 2.5981i
> -4.5000 + 0.7935i
> -4.5000 - 0.7935i
> -4.5000 - 2.5981i
> -4.5000 - 5.3629i
> -4.5000 -12.3636i]
>
> signify?


Well, if the sequence is taken from a program written in C, and if the
variable in question is an enumeration of fruit, and if the mapping
between meaning and numbers goes

1: apples
2: oranges
3: grapes
4: kumquats
5: peaches
6: banannas
7: grapefruit
8: rose hips
9: mangoes,

then the sequence you present means Absolutely Nothing. That doesn't
mean you can't take the DFT of it, just that you have chosen a
mathematical operation that means nothing to the data at hand.

So I will repeat and expand my original assertion, in hopes that by
repetition I can make up for my lack of brilliance: the DFT implicitly
assumes a certain temporal organization of the sequence (not to mention
the assumption that the numbers stand for real quantities), and if those
assumptions are totally invalid for the input, then the output stands
more as an unfortunate comment on the abilities and sensibility of the
practitioner than they stand for any meaningful interpretation of the
data.

Without saying what that sequence means, one may as well pick up a copy
of the I Ching, randomly invent a way to translate ten integers into the
six lines of a hexagram, and use the sequence to predict what you're
going to eat for breakfast tomorrow. Either way the interpretation will
be as accurate and meaningful, and the I Ching is always more fun than
the output of an FFT.

--
www.wescottdesign.com
Reply With Quote
  #11 (permalink)  
Old 09-07-2009, 08:21 PM
Rune Allnor
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

On 7 Sep, 19:44, Tim Wescott <t...@seemywebsite.com> wrote:
> On Mon, 07 Sep 2009 09:48:56 -0700, Rune Allnor wrote:
> > On 7 Sep, 17:36, Tim Wescott <t...@seemywebsite.com> wrote:
> >> On Mon, 07 Sep 2009 08:30:10 -0700, Rune Allnor wrote:
> >> > On 7 Sep, 15:13, julius <juli...@gmail.com> wrote:
> >> >> On Sep 7, 8:00*am, Rune Allnor <all...@tele.ntnu.no> wrote:

>
> >> >> > On 7 Sep, 13:38, Eugen Artus <eugen.ar...@arcor.de> wrote:

>
> >> >> > > Hi!

>
> >> >> > > Suppose there is resistor R and a capacitor C connected in
> >> >> > > series. A voltage U_0 is applied at time t=0. The current in the
> >> >> > > time domain is then

>
> >> >> > > I(t) = U_0/R * e^(-t/RC) * * * * * * * *(1)

>
> >> >> > > Taking a Laplace transform and substituting s by j*2*\pi*f, I
> >> >> > > get the frequency domain current:

>
> >> >> > > I(f) = U_0*C/(j*2*\pi*f*R*C+1) * * * * *(2)

>
> >> >> > > Now the problem: I defined values for U_0, R and C, calculated
> >> >> > > the time domain signal by Eq. 1 and transformed it by DFT (using
> >> >> > > the Python function numpy.fft.rfft). Then, I normalized the
> >> >> > > result by multiplying with 2/N, except the first and the last
> >> >> > > sample, which were multiplied with 1/N. N is the number of
> >> >> > > samples of the time signal.

>
> >> >> > > A comparison with the signal predicted by Eq. 2 shows a
> >> >> > > significant difference. What am I doing wrong?

>
> >> >> > The error you make is that you think that the DFT and the Fourier
> >> >> > Transform are the seame operation. In fact, they are fundamentally
> >> >> > different:

>
> >> >> > - The FT works with infinitely long, continuous-time signals. -
> >> >> > The DFT works with dicrete-time data of finite length.

>
> >> >> > These differences have a couple of consequences, like

>
> >> >> > - The DFT produces a discrete, finite-length spectrum - The FT
> >> >> > produces a continuous, infinitely wide spectrum

>
> >> >> > The FT and the DFT can be linked, but then you have to apply the
> >> >> > sampling theorem, map the frequency response of the RC cirquit to
> >> >> > Z-transform domain by using a BiLinear Transform (BLT), and so on..

>
> >> >> > Rune

>
> >> >> To add to Rune's comment, the DFT operates on discrete, finite,
> >> >> PERIODIC time series and produces a discrete, finite, PERIODIC
> >> >> frequency series.

>
> >> >> One way to get around this is to use zero padding judiciously.

>
> >> > Ah. Here are some data I have lying around:

>
> >> > x = [1,2,3,4,5,6,7,8,9];

>
> >> > Those numbers are all there is to this data set. No more. No less.

>
> >> > Remind me, where is that period?

>
> >> No where. *Which is why you should use the DFT judiciously on this
> >> sequence, because the DFT implicitly assumes a periodic, evenly sampled
> >> sequence and your sequence is not periodic.

>
> > ... so you seem to mean that the DFT can not be used on this sequence?
> > If so, what does the numbers

>
> > X = fft(x) =
> > [ 45.0000
> > * -4.5000 +12.3636i
> > * -4.5000 + 5.3629i
> > * -4.5000 + 2.5981i
> > * -4.5000 + 0.7935i
> > * -4.5000 - 0.7935i
> > * -4.5000 - 2.5981i
> > * -4.5000 - 5.3629i
> > * -4.5000 -12.3636i]

>
> > signify?

>
> Well, if the sequence is taken from a program written in C, and if the
> variable in question is an enumeration of fruit, and if the mapping
> between meaning and numbers goes
>
> 1: apples
> 2: oranges
> 3: grapes
> 4: kumquats
> 5: peaches
> 6: banannas
> 7: grapefruit
> 8: rose hips
> 9: mangoes,
>
> then the sequence you present means Absolutely Nothing. *That doesn't
> mean you can't take the DFT of it, just that you have chosen a
> mathematical operation that means nothing to the data at hand.


The data are given.

Now, incidentially, I have another data series
lying around:

y = [...,8,9,1,2,3,4,5,6,7,8,9,1,2,...]

which is periodic ad infinitum with one period yp
given as

yp = [1,2,3,4,5,6,7,8,9].

The DFT of this sequence is

Y = fft(yp) =
[ 45.0000
-4.5000 +12.3636i
-4.5000 + 5.3629i
-4.5000 + 2.5981i
-4.5000 + 0.7935i
-4.5000 - 0.7935i
-4.5000 - 2.5981i
-4.5000 - 5.3629i
-4.5000 -12.3636i]

I can't tell form the result of the DFT computation
that there is any difference between x and y. Can you?

Of course, there is also the pre- annd post-zero padded
infinite sequence

z = [...,0,0,0,1,2,3,4,5,6,7,8,9,0,0,0]

with nonzero segment zz given as

zz = [1,2,3,4,5,6,7,8,9].

Not surprisingly, the DFT of this segment is

Z = fft(zz) =
[ 45.0000
-4.5000 +12.3636i
-4.5000 + 5.3629i
-4.5000 + 2.5981i
-4.5000 + 0.7935i
-4.5000 - 0.7935i
-4.5000 - 2.5981i
-4.5000 - 5.3629i
-4.5000 -12.3636i]

Not even here do I see any difference with either X or Y.

Could you please explain this?

Rune
Reply With Quote
  #12 (permalink)  
Old 09-07-2009, 11:21 PM
Tim Wescott
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequencydomain

On Mon, 07 Sep 2009 11:21:25 -0700, Rune Allnor wrote:

> On 7 Sep, 19:44, Tim Wescott <t...@seemywebsite.com> wrote:
>> On Mon, 07 Sep 2009 09:48:56 -0700, Rune Allnor wrote:
>> > On 7 Sep, 17:36, Tim Wescott <t...@seemywebsite.com> wrote:
>> >> On Mon, 07 Sep 2009 08:30:10 -0700, Rune Allnor wrote:
>> >> > On 7 Sep, 15:13, julius <juli...@gmail.com> wrote:
>> >> >> On Sep 7, 8:00Â*am, Rune Allnor <all...@tele.ntnu.no> wrote:

>>
>> >> >> > On 7 Sep, 13:38, Eugen Artus <eugen.ar...@arcor.de> wrote:

>>
>> >> >> > > Hi!

>>
>> >> >> > > Suppose there is resistor R and a capacitor C connected in
>> >> >> > > series. A voltage U_0 is applied at time t=0. The current in
>> >> >> > > the time domain is then

>>
>> >> >> > > I(t) = U_0/R * e^(-t/RC) Â* Â* Â* Â* Â* Â* Â* Â*(1)

>>
>> >> >> > > Taking a Laplace transform and substituting s by j*2*\pi*f, I
>> >> >> > > get the frequency domain current:

>>
>> >> >> > > I(f) = U_0*C/(j*2*\pi*f*R*C+1) Â* Â* Â* Â* Â*(2)

>>
>> >> >> > > Now the problem: I defined values for U_0, R and C,
>> >> >> > > calculated the time domain signal by Eq. 1 and transformed it
>> >> >> > > by DFT (using the Python function numpy.fft.rfft). Then, I
>> >> >> > > normalized the result by multiplying with 2/N, except the
>> >> >> > > first and the last sample, which were multiplied with 1/N. N
>> >> >> > > is the number of samples of the time signal.

>>
>> >> >> > > A comparison with the signal predicted by Eq. 2 shows a
>> >> >> > > significant difference. What am I doing wrong?

>>
>> >> >> > The error you make is that you think that the DFT and the
>> >> >> > Fourier Transform are the seame operation. In fact, they are
>> >> >> > fundamentally different:

>>
>> >> >> > - The FT works with infinitely long, continuous-time signals. -
>> >> >> > The DFT works with dicrete-time data of finite length.

>>
>> >> >> > These differences have a couple of consequences, like

>>
>> >> >> > - The DFT produces a discrete, finite-length spectrum - The FT
>> >> >> > produces a continuous, infinitely wide spectrum

>>
>> >> >> > The FT and the DFT can be linked, but then you have to apply
>> >> >> > the sampling theorem, map the frequency response of the RC
>> >> >> > cirquit to Z-transform domain by using a BiLinear Transform
>> >> >> > (BLT), and so on.

>>
>> >> >> > Rune

>>
>> >> >> To add to Rune's comment, the DFT operates on discrete, finite,
>> >> >> PERIODIC time series and produces a discrete, finite, PERIODIC
>> >> >> frequency series.

>>
>> >> >> One way to get around this is to use zero padding judiciously.

>>
>> >> > Ah. Here are some data I have lying around:

>>
>> >> > x = [1,2,3,4,5,6,7,8,9];

>>
>> >> > Those numbers are all there is to this data set. No more. No less.

>>
>> >> > Remind me, where is that period?

>>
>> >> No where. Â*Which is why you should use the DFT judiciously on this
>> >> sequence, because the DFT implicitly assumes a periodic, evenly
>> >> sampled sequence and your sequence is not periodic.

>>
>> > ... so you seem to mean that the DFT can not be used on this
>> > sequence? If so, what does the numbers

>>
>> > X = fft(x) =
>> > [ 45.0000
>> > Â* -4.5000 +12.3636i
>> > Â* -4.5000 + 5.3629i
>> > Â* -4.5000 + 2.5981i
>> > Â* -4.5000 + 0.7935i
>> > Â* -4.5000 - 0.7935i
>> > Â* -4.5000 - 2.5981i
>> > Â* -4.5000 - 5.3629i
>> > Â* -4.5000 -12.3636i]

>>
>> > signify?

>>
>> Well, if the sequence is taken from a program written in C, and if the
>> variable in question is an enumeration of fruit, and if the mapping
>> between meaning and numbers goes
>>
>> 1: apples
>> 2: oranges
>> 3: grapes
>> 4: kumquats
>> 5: peaches
>> 6: banannas
>> 7: grapefruit
>> 8: rose hips
>> 9: mangoes,
>>
>> then the sequence you present means Absolutely Nothing. Â*That doesn't
>> mean you can't take the DFT of it, just that you have chosen a
>> mathematical operation that means nothing to the data at hand.

>
> The data are given.


Why are you playing games today? You've given no data, just some
numbers. Without explaining the meaning of the numbers they are -- well
-- meaningless. That's my whole point. To continue is just to blow
smoke in hopes that my point will be obscured.
>
> Now, incidentially, I have another data series lying around:
>
> y = [...,8,9,1,2,3,4,5,6,7,8,9,1,2,...]
>
> which is periodic ad infinitum with one period yp given as
>
> yp = [1,2,3,4,5,6,7,8,9].
>
> The DFT of this sequence is
>
> Y = fft(yp) =
> [ 45.0000
> -4.5000 +12.3636i
> -4.5000 + 5.3629i
> -4.5000 + 2.5981i
> -4.5000 + 0.7935i
> -4.5000 - 0.7935i
> -4.5000 - 2.5981i
> -4.5000 - 5.3629i
> -4.5000 -12.3636i]
>
> I can't tell form the result of the DFT computation that there is any
> difference between x and y. Can you?


Not from the result of the DFT, but because the DFT can be interpreted as
being exactly correct when applied to periodic, sampled data, then it can
be interpreted as a harmonic decomposition of the original series.

>
> Of course, there is also the pre- annd post-zero padded infinite
> sequence
>
> z = [...,0,0,0,1,2,3,4,5,6,7,8,9,0,0,0]
>
> with nonzero segment zz given as
>
> zz = [1,2,3,4,5,6,7,8,9].
>
> Not surprisingly, the DFT of this segment is
>
> Z = fft(zz) =
> [ 45.0000
> -4.5000 +12.3636i
> -4.5000 + 5.3629i
> -4.5000 + 2.5981i
> -4.5000 + 0.7935i
> -4.5000 - 0.7935i
> -4.5000 - 2.5981i
> -4.5000 - 5.3629i
> -4.5000 -12.3636i]
>
> Not even here do I see any difference with either X or Y.
>
> Could you please explain this?
>
> Rune


And here the DFT is a very crude approximation of what's 'really' going
on with the sequence; the correct way to get a spectrum of this one would
be with a Fourier transform.

But my overall explanation is that you are trying to make my point for
me, by finding numerous examples of randomly applying the DFT to vectors
of numbers in ways that are sometimes potentially meaningful and
sometimes not.

But I can't for the life of me explain why you are doing this, and why
you couch it in language that implies you are doing the opposite.

--
www.wescottdesign.com
Reply With Quote
  #13 (permalink)  
Old 09-08-2009, 12:55 PM
Rune Allnor
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

On 7 Sep, 23:21, Tim Wescott <t...@seemywebsite.com> wrote:
> On Mon, 07 Sep 2009 11:21:25 -0700, Rune Allnor wrote:
> > On 7 Sep, 19:44, Tim Wescott <t...@seemywebsite.com> wrote:
> >> On Mon, 07 Sep 2009 09:48:56 -0700, Rune Allnor wrote:
> >> > On 7 Sep, 17:36, Tim Wescott <t...@seemywebsite.com> wrote:
> >> >> On Mon, 07 Sep 2009 08:30:10 -0700, Rune Allnor wrote:
> >> >> > On 7 Sep, 15:13, julius <juli...@gmail.com> wrote:
> >> >> >> On Sep 7, 8:00*am, Rune Allnor <all...@tele.ntnu.no> wrote:

>
> >> >> >> > On 7 Sep, 13:38, Eugen Artus <eugen.ar...@arcor.de> wrote:

>
> >> >> >> > > Hi!

>
> >> >> >> > > Suppose there is resistor R and a capacitor C connected in
> >> >> >> > > series. A voltage U_0 is applied at time t=0. The current in
> >> >> >> > > the time domain is then

>
> >> >> >> > > I(t) = U_0/R * e^(-t/RC) * * * * * * * *(1)

>
> >> >> >> > > Taking a Laplace transform and substituting s by j*2*\pi*f, I
> >> >> >> > > get the frequency domain current:

>
> >> >> >> > > I(f) = U_0*C/(j*2*\pi*f*R*C+1) * * * * *(2)

>
> >> >> >> > > Now the problem: I defined values for U_0, R and C,
> >> >> >> > > calculated the time domain signal by Eq. 1 and transformed it
> >> >> >> > > by DFT (using the Python function numpy.fft.rfft). Then, I
> >> >> >> > > normalized the result by multiplying with 2/N, except the
> >> >> >> > > first and the last sample, which were multiplied with 1/N. N
> >> >> >> > > is the number of samples of the time signal.

>
> >> >> >> > > A comparison with the signal predicted by Eq. 2 shows a
> >> >> >> > > significant difference. What am I doing wrong?

>
> >> >> >> > The error you make is that you think that the DFT and the
> >> >> >> > Fourier Transform are the seame operation. In fact, they are
> >> >> >> > fundamentally different:

>
> >> >> >> > - The FT works with infinitely long, continuous-time signals. -
> >> >> >> > The DFT works with dicrete-time data of finite length.

>
> >> >> >> > These differences have a couple of consequences, like

>
> >> >> >> > - The DFT produces a discrete, finite-length spectrum - The FT
> >> >> >> > produces a continuous, infinitely wide spectrum

>
> >> >> >> > The FT and the DFT can be linked, but then you have to apply
> >> >> >> > the sampling theorem, map the frequency response of the RC
> >> >> >> > cirquit to Z-transform domain by using a BiLinear Transform
> >> >> >> > (BLT), and so on.

>
> >> >> >> > Rune

>
> >> >> >> To add to Rune's comment, the DFT operates on discrete, finite,
> >> >> >> PERIODIC time series and produces a discrete, finite, PERIODIC
> >> >> >> frequency series.

>
> >> >> >> One way to get around this is to use zero padding judiciously.

>
> >> >> > Ah. Here are some data I have lying around:

>
> >> >> > x = [1,2,3,4,5,6,7,8,9];

>
> >> >> > Those numbers are all there is to this data set. No more. No less..

>
> >> >> > Remind me, where is that period?

>
> >> >> No where. *Which is why you should use the DFT judiciously on this
> >> >> sequence, because the DFT implicitly assumes a periodic, evenly
> >> >> sampled sequence and your sequence is not periodic.

>
> >> > ... so you seem to mean that the DFT can not be used on this
> >> > sequence? If so, what does the numbers

>
> >> > X = fft(x) =
> >> > [ 45.0000
> >> > * -4.5000 +12.3636i
> >> > * -4.5000 + 5.3629i
> >> > * -4.5000 + 2.5981i
> >> > * -4.5000 + 0.7935i
> >> > * -4.5000 - 0.7935i
> >> > * -4.5000 - 2.5981i
> >> > * -4.5000 - 5.3629i
> >> > * -4.5000 -12.3636i]

>
> >> > signify?

>
> >> Well, if the sequence is taken from a program written in C, and if the
> >> variable in question is an enumeration of fruit, and if the mapping
> >> between meaning and numbers goes

>
> >> 1: apples
> >> 2: oranges
> >> 3: grapes
> >> 4: kumquats
> >> 5: peaches
> >> 6: banannas
> >> 7: grapefruit
> >> 8: rose hips
> >> 9: mangoes,

>
> >> then the sequence you present means Absolutely Nothing. *That doesn't
> >> mean you can't take the DFT of it, just that you have chosen a
> >> mathematical operation that means nothing to the data at hand.

>
> > The data are given.

>
> Why are you playing games today? *You've given no data, just some
> numbers.


Those numbers are the data. Numbers are the only kinds of data
you will ever get within the realm of DSP.

>*Without explaining the meaning of the numbers they are -- well
> -- meaningless. *That's my whole point. *To continue is just to blow
> smoke in hopes that my point will be obscured.


I know you are very smart. I suspect you even understand
how ridiculous the "The DFT requires periodic data"
argument is. Of course, considering that almost everybody
else here have bought into the delusion I can understand
that you do not want to break ranks with the rest of the
poeple here.

But again, you are smart enough to see my point. And I'm
pretty sure you do see it.

> > Now, incidentially, I have another data series lying around:

>
> > y = [...,8,9,1,2,3,4,5,6,7,8,9,1,2,...]

>
> > which is periodic ad infinitum with one period yp given as

>
> > yp = [1,2,3,4,5,6,7,8,9].

>
> > The DFT of this sequence is

>
> > Y = fft(yp) =
> > [ 45.0000
> > * -4.5000 +12.3636i
> > * -4.5000 + 5.3629i
> > * -4.5000 + 2.5981i
> > * -4.5000 + 0.7935i
> > * -4.5000 - 0.7935i
> > * -4.5000 - 2.5981i
> > * -4.5000 - 5.3629i
> > * -4.5000 -12.3636i]

>
> > I can't tell form the result of the DFT computation that there is any
> > difference between x and y. Can you?

>
> Not from the result of the DFT, but because the DFT can be interpreted as
> being exactly correct when applied to periodic, sampled data, then it can
> be interpreted as a harmonic decomposition of the original series.


The DFT can not interpret anything, because the DFT 'sees'
a ninite set of numbers, and does its thing with those
numbers that happen to be presented to it. No more. No less.

> > Of course, there is also the pre- annd post-zero padded infinite
> > sequence

>
> > z = [...,0,0,0,1,2,3,4,5,6,7,8,9,0,0,0]

>
> > with nonzero segment zz given as

>
> > zz = [1,2,3,4,5,6,7,8,9].

>
> > Not surprisingly, the DFT of this segment is

>
> > Z = fft(zz) =
> > [ 45.0000
> > * -4.5000 +12.3636i
> > * -4.5000 + 5.3629i
> > * -4.5000 + 2.5981i
> > * -4.5000 + 0.7935i
> > * -4.5000 - 0.7935i
> > * -4.5000 - 2.5981i
> > * -4.5000 - 5.3629i
> > * -4.5000 -12.3636i]

>
> > Not even here do I see any difference with either X or Y.

>
> > Could you please explain this?

>
> > Rune

>
> And here the DFT is a very crude approximation of what's 'really' going
> on with the sequence; the correct way to get a spectrum of this one would
> be with a Fourier transform.


Doesn't matter. I used the numbers as arguments to the DFT.
Your point seems to be that in case 1, my use of the DFT
is wrong because no more numbers exist in the data set than
those I feed to the DFT. In case 2 you seem to think that
using the DFT is correct, because of the data items I *don't*
feed to the DFT. In this last case, that argument turns
straight and all of a sudden the DFT is wrong because of the
data points I *don't* feed to the DFT.

Would you ever present that sort of argument to a paying
customer? If so, would you be surprised if the same paying
customer called in people to express a 2nd, a 3rd and
maybe even a 4th opinion?

> But my overall explanation is that you are trying to make my point for
> me, by finding numerous examples of randomly applying the DFT to vectors
> of numbers in ways that are sometimes potentially meaningful and
> sometimes not.


The result of the DFT always 'means' the same thing: How
a given data set can be expressed in terms of a set of
complex-valued basis vectors in an N-dimensional vector space.

> But I can't for the life of me explain why you are doing this, and why
> you couch it in language that implies you are doing the opposite.


Again, you are a smart guy. You are amongst the very few
people here that

a) are smart enouhg to see that the DFT is nothing more
than a basis shift transform of the data actually
presented to the algorithm.
b) pragmatic enough to actually change your opinions once
you see that you have been wrong.

Over the past few weeks I have come to realize that people
I used to respect for their knowledge and skills, suffer
from this DFT delution. This was too good an opportunity to
test out if these people really are as stupid as they appear.

Rune
Reply With Quote
  #14 (permalink)  
Old 09-08-2009, 01:49 PM
Eugen Artus
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

Hi Rune!

> The FT and the DFT can be linked, but then you have to
> apply the sampling theorem, map the frequency response
> of the RC cirquit to Z-transform domain by using a
> BiLinear Transform (BLT), and so on.


Ok. Would you be so kind to give a brief outline of the necessary steps to
solve this particular problem? Of course, any recommendations regarding
literature or websites are very welcome, too.

Thank you!

Eugen

Reply With Quote
  #15 (permalink)  
Old 09-08-2009, 02:27 PM
Rune Allnor
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

On 8 Sep, 13:49, Eugen Artus <eugen.ar...@arcor.de> wrote:
> Hi Rune!
>
> > The FT and the DFT can be linked, but then you have to
> > apply the sampling theorem, map the frequency response
> > of the RC cirquit to Z-transform domain by using a
> > BiLinear Transform (BLT), and so on.

>
> Ok. Would you be so kind to give a brief outline of the necessary steps to
> solve this particular problem? Of course, any recommendations regarding
> literature or websites are very welcome, too.


What problem?

If you want to study the RC cirquit in question, use the
continuous-time form of the FT, not the DFT. That is,
evaluate the Laplace transform H(s) on the imaginary
axis, and map the poles and/or zeros in s domain.

As for the BLT, it is used when one wants to design a
discrete-time filter from an analog prototype. There are
plenty of details to consider, like nonlinearities in
the mapping of frequencies. The imaginary axis in s domain
is mapped to the unit circle in z domain. You alos have
to deal with sampling rates etc.

In essence:

1) The results in z domain are different from the results
in s domain
2) One does the mapping for very specific reasons

As I understand your post, you want to study the RC circuit.
If correct, there is no point in going through the motions
to map to z domain.

If you want to look into these things, check out an
intermediate level text on DSP; the intro texts might not
get into the details of these matters. I am most familiar
with the book by Proakis and Manolakis, but the books by
Oppenheim and Schafer (they have co-authored several) are
also popular.

Rune
Reply With Quote
  #16 (permalink)  
Old 09-08-2009, 05:32 PM
Jerry Avins
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

Rune Allnor wrote:

...

> Doesn't matter. I used the numbers as arguments to the DFT.
> Your point seems to be that in case 1, my use of the DFT
> is wrong because no more numbers exist in the data set than
> those I feed to the DFT. In case 2 you seem to think that
> using the DFT is correct, because of the data items I *don't*
> feed to the DFT. In this last case, that argument turns
> straight and all of a sudden the DFT is wrong because of the
> data points I *don't* feed to the DFT.
>
> Would you ever present that sort of argument to a paying
> customer? If so, would you be surprised if the same paying
> customer called in people to express a 2nd, a 3rd and
> maybe even a 4th opinion?
>
>> But my overall explanation is that you are trying to make my point for
>> me, by finding numerous examples of randomly applying the DFT to vectors
>> of numbers in ways that are sometimes potentially meaningful and
>> sometimes not.

>
> The result of the DFT always 'means' the same thing: How
> a given data set can be expressed in terms of a set of
> complex-valued basis vectors in an N-dimensional vector space.
>
>> But I can't for the life of me explain why you are doing this, and why
>> you couch it in language that implies you are doing the opposite.

>
> Again, you are a smart guy. You are amongst the very few
> people here that
>
> a) are smart enough to see that the DFT is nothing more
> than a basis shift transform of the data actually
> presented to the algorithm.
> b) pragmatic enough to actually change your opinions once
> you see that you have been wrong.
>
> Over the past few weeks I have come to realize that people
> I used to respect for their knowledge and skills, suffer
> from this DFT delution. This was too good an opportunity to
> test out if these people really are as stupid as they appear.


I don't think anyone here claims that a DFT is legitimate only with
periodic data. What is claimed is that the operation on a finite
sequence gives the same result as operating on a repeated duplication of
that sequence, or on a circularly shifted version of it. You ably
demonstrated that in this thread. There are applications where this
property matters, and where ignoring it leads to error.

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #17 (permalink)  
Old 09-08-2009, 05:50 PM
Jerry Avins
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

Eugen Artus wrote:
> Hi Rune!
>
>> The FT and the DFT can be linked, but then you have to
>> apply the sampling theorem, map the frequency response
>> of the RC cirquit to Z-transform domain by using a
>> BiLinear Transform (BLT), and so on.

>
> Ok. Would you be so kind to give a brief outline of the necessary steps to
> solve this particular problem? Of course, any recommendations regarding
> literature or websites are very welcome, too.
>
> Thank you!


Sampling is useful only for bandlimited signals. An exponential decay is
not bandlimited. There are two standard ways to model the continuous (s)
domain as discrete. The (to me) more intuitively obvious is "impulse
invariance" which models an analog circuit's impulse response as well as
a sampled system can. The bilinear transform that Rune mentioned is more
complicated (frequency warping and all that) but generally gives more
satisfactory results. At http://www.bores.com/courses/intro/index.htm
you canead about both.

If x[n] are succesive outputs and y[n] are succesive outputs, an
exponential decay can be modeled as y[n]=a*x[n]+(1-a)*y[n-1]. When a is
small, the time constant is long. 0<a<1

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #18 (permalink)  
Old 09-08-2009, 06:17 PM
Tim Wescott
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequencydomain

On Tue, 08 Sep 2009 03:55:50 -0700, Rune Allnor wrote:

> On 7 Sep, 23:21, Tim Wescott <t...@seemywebsite.com> wrote:
>> On Mon, 07 Sep 2009 11:21:25 -0700, Rune Allnor wrote:
>> > On 7 Sep, 19:44, Tim Wescott <t...@seemywebsite.com> wrote:
>> >> On Mon, 07 Sep 2009 09:48:56 -0700, Rune Allnor wrote:
>> >> > On 7 Sep, 17:36, Tim Wescott <t...@seemywebsite.com> wrote:
>> >> >> On Mon, 07 Sep 2009 08:30:10 -0700, Rune Allnor wrote:
>> >> >> > On 7 Sep, 15:13, julius <juli...@gmail.com> wrote:
>> >> >> >> On Sep 7, 8:00Â*am, Rune Allnor <all...@tele.ntnu.no> wrote:

>>
>> >> >> >> > On 7 Sep, 13:38, Eugen Artus <eugen.ar...@arcor.de> wrote:

>>
>> >> >> >> > > Hi!

>>
>> >> >> >> > > Suppose there is resistor R and a capacitor C connected in
>> >> >> >> > > series. A voltage U_0 is applied at time t=0. The current
>> >> >> >> > > in the time domain is then

>>
>> >> >> >> > > I(t) = U_0/R * e^(-t/RC) Â* Â* Â* Â* Â* Â* Â* Â*(1)

>>
>> >> >> >> > > Taking a Laplace transform and substituting s by
>> >> >> >> > > j*2*\pi*f, I get the frequency domain current:

>>
>> >> >> >> > > I(f) = U_0*C/(j*2*\pi*f*R*C+1) Â* Â* Â* Â* Â*(2)

>>
>> >> >> >> > > Now the problem: I defined values for U_0, R and C,
>> >> >> >> > > calculated the time domain signal by Eq. 1 and transformed
>> >> >> >> > > it by DFT (using the Python function numpy.fft.rfft).
>> >> >> >> > > Then, I normalized the result by multiplying with 2/N,
>> >> >> >> > > except the first and the last sample, which were
>> >> >> >> > > multiplied with 1/N. N is the number of samples of the
>> >> >> >> > > time signal.

>>
>> >> >> >> > > A comparison with the signal predicted by Eq. 2 shows a
>> >> >> >> > > significant difference. What am I doing wrong?

>>
>> >> >> >> > The error you make is that you think that the DFT and the
>> >> >> >> > Fourier Transform are the seame operation. In fact, they are
>> >> >> >> > fundamentally different:

>>
>> >> >> >> > - The FT works with infinitely long, continuous-time
>> >> >> >> > signals. - The DFT works with dicrete-time data of finite
>> >> >> >> > length.

>>
>> >> >> >> > These differences have a couple of consequences, like

>>
>> >> >> >> > - The DFT produces a discrete, finite-length spectrum - The
>> >> >> >> > FT produces a continuous, infinitely wide spectrum

>>
>> >> >> >> > The FT and the DFT can be linked, but then you have to apply
>> >> >> >> > the sampling theorem, map the frequency response of the RC
>> >> >> >> > cirquit to Z-transform domain by using a BiLinear Transform
>> >> >> >> > (BLT), and so on.

>>
>> >> >> >> > Rune

>>
>> >> >> >> To add to Rune's comment, the DFT operates on discrete,
>> >> >> >> finite, PERIODIC time series and produces a discrete, finite,
>> >> >> >> PERIODIC frequency series.

>>
>> >> >> >> One way to get around this is to use zero padding judiciously.

>>
>> >> >> > Ah. Here are some data I have lying around:

>>
>> >> >> > x = [1,2,3,4,5,6,7,8,9];

>>
>> >> >> > Those numbers are all there is to this data set. No more. No
>> >> >> > less.

>>
>> >> >> > Remind me, where is that period?

>>
>> >> >> No where. Â*Which is why you should use the DFT judiciously on
>> >> >> this sequence, because the DFT implicitly assumes a periodic,
>> >> >> evenly sampled sequence and your sequence is not periodic.

>>
>> >> > ... so you seem to mean that the DFT can not be used on this
>> >> > sequence? If so, what does the numbers

>>
>> >> > X = fft(x) =
>> >> > [ 45.0000
>> >> > Â* -4.5000 +12.3636i
>> >> > Â* -4.5000 + 5.3629i
>> >> > Â* -4.5000 + 2.5981i
>> >> > Â* -4.5000 + 0.7935i
>> >> > Â* -4.5000 - 0.7935i
>> >> > Â* -4.5000 - 2.5981i
>> >> > Â* -4.5000 - 5.3629i
>> >> > Â* -4.5000 -12.3636i]

>>
>> >> > signify?

>>
>> >> Well, if the sequence is taken from a program written in C, and if
>> >> the variable in question is an enumeration of fruit, and if the
>> >> mapping between meaning and numbers goes

>>
>> >> 1: apples
>> >> 2: oranges
>> >> 3: grapes
>> >> 4: kumquats
>> >> 5: peaches
>> >> 6: banannas
>> >> 7: grapefruit
>> >> 8: rose hips
>> >> 9: mangoes,

>>
>> >> then the sequence you present means Absolutely Nothing. Â*That
>> >> doesn't mean you can't take the DFT of it, just that you have chosen
>> >> a mathematical operation that means nothing to the data at hand.

>>
>> > The data are given.

>>
>> Why are you playing games today? Â*You've given no data, just some
>> numbers.

>
> Those numbers are the data. Numbers are the only kinds of data you will
> ever get within the realm of DSP.
>
>>Â*Without explaining the meaning of the numbers they are -- well
>> -- meaningless. Â*That's my whole point. Â*To continue is just to blow
>> smoke in hopes that my point will be obscured.

>
> I know you are very smart. I suspect you even understand how ridiculous
> the "The DFT requires periodic data" argument is. Of course, considering
> that almost everybody else here have bought into the delusion I can
> understand that you do not want to break ranks with the rest of the
> poeple here.
>
> But again, you are smart enough to see my point. And I'm pretty sure you
> do see it.


I'd accept that I'm smart enough to see your point, except that I'm
clearly (at least it's clear to me!) confused. Perhaps it's that
pragmatism you accuse me of (more on that later).

But for now you'll have to accept that I'm at least partially dense.

>> > Now, incidentially, I have another data series lying around:

>>
>> > y = [...,8,9,1,2,3,4,5,6,7,8,9,1,2,...]

>>
>> > which is periodic ad infinitum with one period yp given as

>>
>> > yp = [1,2,3,4,5,6,7,8,9].

>>
>> > The DFT of this sequence is

>>
>> > Y = fft(yp) =
>> > [ 45.0000
>> > Â* -4.5000 +12.3636i
>> > Â* -4.5000 + 5.3629i
>> > Â* -4.5000 + 2.5981i
>> > Â* -4.5000 + 0.7935i
>> > Â* -4.5000 - 0.7935i
>> > Â* -4.5000 - 2.5981i
>> > Â* -4.5000 - 5.3629i
>> > Â* -4.5000 -12.3636i]

>>
>> > I can't tell form the result of the DFT computation that there is any
>> > difference between x and y. Can you?

>>
>> Not from the result of the DFT, but because the DFT can be interpreted
>> as being exactly correct when applied to periodic, sampled data, then
>> it can be interpreted as a harmonic decomposition of the original
>> series.

>
> The DFT can not interpret anything, because the DFT 'sees' a ninite set
> of numbers, and does its thing with those numbers that happen to be
> presented to it. No more. No less.
>
>> > Of course, there is also the pre- annd post-zero padded infinite
>> > sequence

>>
>> > z = [...,0,0,0,1,2,3,4,5,6,7,8,9,0,0,0]

>>
>> > with nonzero segment zz given as

>>
>> > zz = [1,2,3,4,5,6,7,8,9].

>>
>> > Not surprisingly, the DFT of this segment is

>>
>> > Z = fft(zz) =
>> > [ 45.0000
>> > Â* -4.5000 +12.3636i
>> > Â* -4.5000 + 5.3629i
>> > Â* -4.5000 + 2.5981i
>> > Â* -4.5000 + 0.7935i
>> > Â* -4.5000 - 0.7935i
>> > Â* -4.5000 - 2.5981i
>> > Â* -4.5000 - 5.3629i
>> > Â* -4.5000 -12.3636i]

>>
>> > Not even here do I see any difference with either X or Y.

>>
>> > Could you please explain this?

>>
>> > Rune

>>
>> And here the DFT is a very crude approximation of what's 'really' going
>> on with the sequence; the correct way to get a spectrum of this one
>> would be with a Fourier transform.

>
> Doesn't matter. I used the numbers as arguments to the DFT. Your point
> seems to be that in case 1, my use of the DFT is wrong because no more
> numbers exist in the data set than those I feed to the DFT. In case 2
> you seem to think that using the DFT is correct, because of the data
> items I *don't* feed to the DFT. In this last case, that argument turns
> straight and all of a sudden the DFT is wrong because of the data points
> I *don't* feed to the DFT.
>
> Would you ever present that sort of argument to a paying customer? If
> so, would you be surprised if the same paying customer called in people
> to express a 2nd, a 3rd and maybe even a 4th opinion?


I would present an expanded version of that sort of argument to a paying
customer, yes -- in fact I have done that sort of thing before. I'd
expect to meet opposition because of inertia of thought, and that's why
I'd expand it. But if it were necessary (e.g. to convince a customer
that a certain approach needed to be taken) I'd do it.

What my argument boils down to is that for the analysis to be meaningful
in addition to being mathematically correct then (a) the numbers have to
represent something that's useful to have broken down into frequency
components (there's that danged pragmatism!) and (b) the data set that
ends up getting transformed -- _after_ windowing, etc. -- has to be a
reasonable approximation of whatever you started with.

I see these two conditions violated all the time; sometimes by folks who
should know better, sometimes by folks who have somehow gotten the notion
that "DSP == FFT" and feel that they can get something useful by blind
application of the FFT operation.

>> But my overall explanation is that you are trying to make my point for
>> me, by finding numerous examples of randomly applying the DFT to
>> vectors of numbers in ways that are sometimes potentially meaningful
>> and sometimes not.

>
> The result of the DFT always 'means' the same thing: How a given data
> set can be expressed in terms of a set of complex-valued basis vectors
> in an N-dimensional vector space.


Absolutely true, in a purely mathematical sense. But as I tried to point
out in my 'fruity' example, the resulting set of basis vectors may have
absolutely no meaning at all with respect to the problem at hand. So
like any other mathematical analysis tool one must ask oneself (or one's
collaborators) what level of relevance the tool has to the problem you're
trying to solve.

(Note that I can't think of any example of any data set that's the result
of evenly sampling and measuring some quantity in time, space, or any
other meaningful dimension where you wouldn't find _some_ use in doing
some spectral analysis, although I can think of a few [i.e. spread
spectrum] where an FFT is of limited use).

>> But I can't for the life of me explain why you are doing this, and why
>> you couch it in language that implies you are doing the opposite.

>
> Again, you are a smart guy. You are amongst the very few people here
> that
>
> a) are smart enouhg to see that the DFT is nothing more
> than a basis shift transform of the data actually presented to the
> algorithm.
> b) pragmatic enough to actually change your opinions once
> you see that you have been wrong.
>
> Over the past few weeks I have come to realize that people I used to
> respect for their knowledge and skills,


Perhaps you're just getting cranky because it's fall and the light's
failing? I've always found that really working to equate the meaning of
what comes out of a Fourier transform to the 'real world' is mind-
bending; what looks like a mountain in Fourier space might be a symphony
in temporal space. So I can't blame people for not being able to wrap
their brains around this stuff without a lot of effort -- although when
_I'm_ cranky I'm more likely to.

> suffer from this DFT delusion.
> This was too good an opportunity to test out if these people really are
> as stupid as they appear.


I think "delusion" is too strong a word. 'Limited view', perhaps.

I'll assert right here that it is correct to say that if you're taking
the spectra of a physical signal in the sense of a Fourier transform then
the DFT _itself_ is only _exact_ for exactly periodic (and sampled)
signals (or ones on a circular domain -- if you can find them). But when
I say "not exact" I certainly don't mean "not useful" or "inappropriate",
at least not without more data.

The point that I try to make in the use of the DFT (or 'FFT' for the "DSP
== FFT and I don't know what this DFT thing is" folks) is that you start
from a real-world signal that is infinite in extent, and you truncate it
(forget sampling for the moment). That truncated signal is but an
approximation of the actual signal. Then you perform a DFT on it. If
you blindly expect the output of the DFT to be exactly representative of
the characteristics of the real signal then you are leading yourself into
error -- not because the DFT is an approximation, but because the only
possible _input_ to the DFT is an approximation for all but a narrow
class of signals, a class into which most real-world signals do not fall.

Where I see people falling into error in the use of the DFT isn't the
line of Matlab code that says spectrumX = fft(x); it's the (often
implicit) assumption that their captured vector of samples 'x' actually
matches some physical reality that they want to test.

So while I have a good idea of where _I_ want to go, I'm still pretty
unclear on where you want to lead me.

--
www.wescottdesign.com
Reply With Quote
  #19 (permalink)  
Old 09-08-2009, 06:19 PM
Rune Allnor
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

On 8 Sep, 17:32, Jerry Avins <j...@ieee.org> wrote:
> Rune Allnor wrote:
>
> * *...
>
>
>
>
>
> > Doesn't matter. I used the numbers as arguments to the DFT.
> > Your point seems to be that in case 1, my use of the DFT
> > is wrong because no more numbers exist in the data set than
> > those I feed to the DFT. In case 2 you seem to think that
> > using the DFT is correct, because of the data items I *don't*
> > feed to the DFT. In this last case, that argument turns
> > straight and all of a sudden the DFT is wrong because of the
> > data points I *don't* feed to the DFT.

>
> > Would you ever present that sort of argument to a paying
> > customer? If so, would you be surprised if the same paying
> > customer called in people to express a 2nd, a 3rd and
> > maybe even a 4th opinion?

>
> >> But my overall explanation is that you are trying to make my point for
> >> me, by finding numerous examples of randomly applying the DFT to vectors
> >> of numbers in ways that are sometimes potentially meaningful and
> >> sometimes not.

>
> > The result of the DFT always 'means' the same thing: How
> > a given data set can be expressed in terms of a set of
> > complex-valued basis vectors in an N-dimensional vector space.

>
> >> But I can't for the life of me explain why you are doing this, and why
> >> you couch it in language that implies you are doing the opposite.

>
> > Again, you are a smart guy. You are amongst the very few
> > people here that

>
> > a) are smart enough to see that the DFT is nothing more
> > * *than a basis shift transform of the data actually
> > * *presented to the algorithm.
> > b) pragmatic enough to actually change your opinions once
> > * *you see that you have been wrong.

>
> > Over the past few weeks I have come to realize that people
> > I used to respect for their knowledge and skills, suffer
> > from this DFT delution. This was too good an opportunity to
> > test out if these people really are as stupid as they appear.

>
> I don't think anyone here claims that a DFT is legitimate only with
> periodic data.


From a previpouis post,

http://groups.google.no/group/comp.d...4f78bcfc?hl=no

pisted by Julius:

"To add to Rune's comment, the DFT operates on discrete,
finite, PERIODIC time series and produces a discrete, finite,
PERIODIC frequency series."

How is it possible to read the above and *not* get the
impression that Jusius makes exatly that claim?

> What is claimed is that the operation on a finite
> sequence gives the same result as operating on a repeated duplication of
> that sequence, or on a circularly shifted version of it. You ably
> demonstrated that in this thread.


I stand corrected. There are more people than Tim around
that has the potential to read and understand an argument,
and also change their minds.

Thanks, Jerry. My your post means that my faith in Homo
Sapiens as an occasionally intelligent creature didn't
shatter completely. Quite yet.

Rune
Reply With Quote
  #20 (permalink)  
Old 09-08-2009, 06:22 PM
Tim Wescott
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequencydomain

On Mon, 07 Sep 2009 13:38:39 +0200, Eugen Artus wrote:

> Hi!
>
> Suppose there is resistor R and a capacitor C connected in series. A
> voltage U_0 is applied at time t=0. The current in the time domain is
> then
>
> I(t) = U_0/R * e^(-t/RC) (1)
>
> Taking a Laplace transform and substituting s by j*2*\pi*f, I get the
> frequency domain current:
>
> I(f) = U_0*C/(j*2*\pi*f*R*C+1) (2)
>
> Now the problem: I defined values for U_0, R and C, calculated the time
> domain signal by Eq. 1 and transformed it by DFT (using the Python
> function numpy.fft.rfft). Then, I normalized the result by multiplying
> with 2/N, except the first and the last sample, which were multiplied
> with 1/N. N is the number of samples of the time signal.
>
> A comparison with the signal predicted by Eq. 2 shows a significant
> difference. What am I doing wrong?


(sorry for getting off on the tangent without answering your real
question).

What you are doing wrong is trying to answer a continuous-time question
with sampled-time analysis tools. Would you drive a nail with a
screwdriver? Screw in a screw with a wrench? Tighten a nut with a
hammer? Screws, nuts and nails are all fasteners; hammers, screwdrivers
and wrenches are all tools to make fasteners work, yet use the wrong tool
for a perfectly good fastener and you'll do no good at all. Similarly,
the Laplace transform is the right tool for analyzing continuous-time
ordinary linear differential equations, which is what you're working with.

Keep your analysis in the Laplace domain, and things should work well.
If you're trying to analyze what happens if you sample the result of the
continuous-time operation then say so, and someone will point out how to
do that part.

--
www.wescottdesign.com
Reply With Quote
  #21 (permalink)  
Old 09-08-2009, 06:28 PM
Jerry Avins
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

Rune Allnor wrote:
> On 8 Sep, 17:32, Jerry Avins <j...@ieee.org> wrote:
>> Rune Allnor wrote:
>>
>> ...
>>
>>
>>
>>
>>
>>> Doesn't matter. I used the numbers as arguments to the DFT.
>>> Your point seems to be that in case 1, my use of the DFT
>>> is wrong because no more numbers exist in the data set than
>>> those I feed to the DFT. In case 2 you seem to think that
>>> using the DFT is correct, because of the data items I *don't*
>>> feed to the DFT. In this last case, that argument turns
>>> straight and all of a sudden the DFT is wrong because of the
>>> data points I *don't* feed to the DFT.
>>> Would you ever present that sort of argument to a paying
>>> customer? If so, would you be surprised if the same paying
>>> customer called in people to express a 2nd, a 3rd and
>>> maybe even a 4th opinion?
>>>> But my overall explanation is that you are trying to make my point for
>>>> me, by finding numerous examples of randomly applying the DFT to vectors
>>>> of numbers in ways that are sometimes potentially meaningful and
>>>> sometimes not.
>>> The result of the DFT always 'means' the same thing: How
>>> a given data set can be expressed in terms of a set of
>>> complex-valued basis vectors in an N-dimensional vector space.
>>>> But I can't for the life of me explain why you are doing this, and why
>>>> you couch it in language that implies you are doing the opposite.
>>> Again, you are a smart guy. You are amongst the very few
>>> people here that
>>> a) are smart enough to see that the DFT is nothing more
>>> than a basis shift transform of the data actually
>>> presented to the algorithm.
>>> b) pragmatic enough to actually change your opinions once
>>> you see that you have been wrong.
>>> Over the past few weeks I have come to realize that people
>>> I used to respect for their knowledge and skills, suffer
>>> from this DFT delution. This was too good an opportunity to
>>> test out if these people really are as stupid as they appear.

>> I don't think anyone here claims that a DFT is legitimate only with
>> periodic data.

>
> From a previpouis post,
>
> http://groups.google.no/group/comp.d...4f78bcfc?hl=no
>
> pisted by Julius:
>
> "To add to Rune's comment, the DFT operates on discrete,
> finite, PERIODIC time series and produces a discrete, finite,
> PERIODIC frequency series."
>
> How is it possible to read the above and *not* get the
> impression that Jusius makes exatly that claim?


That's what a DFT does. That's not to say it's the only useful way to
use it. Ask the DFT what a particular term X[n] is and it will tell you.
Ask what X[n+N] is, and it will tell you exactly the same thing, whether
that makes sense or not. The periodicity is there whether we ignore it
(the usual case) or not.

>> What is claimed is that the operation on a finite
>> sequence gives the same result as operating on a repeated duplication of
>> that sequence, or on a circularly shifted version of it. You ably
>> demonstrated that in this thread.

>
> I stand corrected. There are more people than Tim around
> that has the potential to read and understand an argument,
> and also change their minds.
>
> Thanks, Jerry. My your post means that my faith in Homo
> Sapiens as an occasionally intelligent creature didn't
> shatter completely. Quite yet.


I'm delighted to be an agent of hope.

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #22 (permalink)  
Old 09-08-2009, 06:42 PM
glen herrmannsfeldt
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

Tim Wescott <[email protected]> wrote:
(snip)

< What you are doing wrong is trying to answer a continuous-time question
< with sampled-time analysis tools. Would you drive a nail with a
< screwdriver? Screw in a screw with a wrench? Tighten a nut with a
< hammer? Screws, nuts and nails are all fasteners; hammers, screwdrivers
< and wrenches are all tools to make fasteners work, yet use the wrong tool
< for a perfectly good fastener and you'll do no good at all. Similarly,
< the Laplace transform is the right tool for analyzing continuous-time
< ordinary linear differential equations, which is what you're working with.

This is true. Still, there are many cases where continuous data
must be analyzed with discrete techniques. For sufficiently large N,
a DFT becomes a sufficiently close approximation to the continuous
transform.

You can, for example, show that the Fourier Transform of a Guassian
is a Gaussian using the FFT. You do have to remember where zero is,
and supply enough points. With fast computers, one can apply the
FFT to very large data sets. (I am still interested in the FFT
of an entire CD, for example.)

-- glen
Reply With Quote
  #23 (permalink)  
Old 09-08-2009, 07:02 PM
Rune Allnor
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

On 8 Sep, 18:28, Jerry Avins <j...@ieee.org> wrote:
> >> What is claimed is that the operation on a finite
> >> sequence gives the same result as operating on a repeated duplication of
> >> that sequence, or on a circularly shifted version of it. You ably
> >> demonstrated that in this thread.

>
> > I stand corrected. There are more people than Tim around
> > that has the potential to read and understand an argument,
> > and also change their minds.

>
> > Thanks, Jerry. My your post means that my faith in Homo
> > Sapiens as an occasionally intelligent creature didn't
> > shatter completely. Quite yet.

>
> I'm delighted to be an agent of hope.


Alas. You might have postponed my descent into the
abyss, maybe. But not brought hope.

Rune
Reply With Quote
  #24 (permalink)  
Old 09-08-2009, 07:17 PM
Rune Allnor
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequency domain

On 8 Sep, 18:17, Tim Wescott <t...@seemywebsite.com> wrote:


> What my argument boils down to is that for the analysis to be meaningful
> in addition to being mathematically correct then (a) the numbers have to
> represent something that's useful to have broken down into frequency
> components (there's that danged pragmatism!)


Exactky. Let go of the notion that 'the numbers have
to *mean* something' and you would be a far better
engineer. And mathematician.

> >> But my overall explanation is that you are trying to make my point for
> >> me, by finding numerous examples of randomly applying the DFT to
> >> vectors of numbers in ways that are sometimes potentially meaningful
> >> and sometimes not.

>
> > The result of the DFT always 'means' the same thing: How a given data
> > set can be expressed in terms of a set of complex-valued basis vectors
> > in an N-dimensional vector space.

>
> Absolutely true, in a purely mathematical sense.


Hold on to that thought!

> *But as I tried to point
> out in my 'fruity' example, the resulting set of basis vectors may have
> absolutely no meaning at all with respect to the problem at hand. *So
> like any other mathematical analysis tool one must ask oneself (or one's
> collaborators) what level of relevance the tool has to the problem you're
> trying to solve.


Exactly. Now, elaborate on that idea:

The reason why people use the DFT is that it is the *only*
flavour of the Fourier Transforms that work on

a) Finite amounts of data
b) Discrete data.

Break any one of those (infinite amounts of data or continuous
data) and the digital computer is of little use to you.

As you repeatedly point out, one often is interested in some
other flavour of the FT, but for *pragmatic* reasons one can
only work with the DFT.

> >> But I can't for the life of me explain why you are doing this, and why
> >> you couch it in language that implies you are doing the opposite.

>
> > Again, you are a smart guy. You are amongst the very few people here
> > that

>
> > a) are smart enouhg to see that the DFT is nothing more
> > * *than a basis shift transform of the data actually presented to the
> > * *algorithm.
> > b) pragmatic enough to actually change your opinions once
> > * *you see that you have been wrong.

>
> > Over the past few weeks I have come to realize that people I used to
> > respect for their knowledge and skills,

>
> Perhaps you're just getting cranky because it's fall and the light's
> failing?


Nope. Now is my best time of the year; reasonably light and cool
(not cold) weather.

> > suffer from this DFT delusion.
> > This was too good an opportunity to test out if these people really are
> > as stupid as they appear.

>
> I think "delusion" is too strong a word. *'Limited view', perhaps. *
>
> I'll assert right here that it is correct to say that if you're taking
> the spectra of a physical signal in the sense of a Fourier transform then
> the DFT _itself_ is only _exact_ for exactly periodic (and sampled)
> signals (or ones on a circular domain -- if you can find them).


This is where you - and just about everybody else - go wrong.
Go back to the statements you agreed with above, that the
DFT is a basis transform in N-dimensional vector space where
N is finite. Since you agreed with that statement, you will
have to marry it with the statement you made here, about
periodic sequences.

It's only one way to do that: By the pragmatic point of view,
where one would *want* to compute the DTFT, but is limited
to actually compute the DFT.

What you end up with, is that the (continuous w domain) DTFT
over one period of an infinitely long, periodic sequence with
period N *happens* to be non-zero at exactly the same normalized
frequencies where the (discrete) coefficients of the DFT are
located; AND that the continuous w in detween these discrete
non-vanishing DTFT coefficients is 0.

This is a coincidence. Not a defining property.

> So while I have a good idea of where _I_ want to go, I'm still pretty
> unclear on where you want to lead me.


You have already outlined the arguments and ideas I would like
you to see. The only thing left I might wish for, is that you
contemplate them.

Rune
Reply With Quote
  #25 (permalink)  
Old 09-08-2009, 07:17 PM
Tim Wescott
Guest
 
Posts: n/a
Default Re: Modelling of a RC series connection in time and frequencydomain

On Tue, 08 Sep 2009 16:42:42 +0000, glen herrmannsfeldt wrote:

> Tim Wescott <[email protected]> wrote: (snip)
>
> < What you are doing wrong is trying to answer a continuous-time
> question < with sampled-time analysis tools. Would you drive a nail
> with a < screwdriver? Screw in a screw with a wrench? Tighten a nut
> with a < hammer? Screws, nuts and nails are all fasteners; hammers,
> screwdrivers < and wrenches are all tools to make fasteners work, yet
> use the wrong tool < for a perfectly good fastener and you'll do no good
> at all. Similarly, < the Laplace transform is the right tool for
> analyzing continuous-time < ordinary linear differential equations,
> which is what you're working with.
>
> This is true. Still, there are many cases where continuous data must be
> analyzed with discrete techniques. For sufficiently large N, a DFT
> becomes a sufficiently close approximation to the continuous transform.
>
> You can, for example, show that the Fourier Transform of a Guassian is a
> Gaussian using the FFT. You do have to remember where zero is, and
> supply enough points. With fast computers, one can apply the FFT to
> very large data sets. (I am still interested in the FFT of an entire
> CD, for example.)
>

No argument -- but if the OP is really analyzing a lumped-element linear
circuit, then Laplace analysis is the way to go, particularly for such a
simple one. If nothing else, doing so gives you a symbolic answer, which
makes it much easier to play "what if" games with component values.

--
www.wescottdesign.com
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to interpolation in frequency domain will not affect time domain signal? coly DSP 11 07-02-2009 06:26 AM
IFFT of custom frequency array - confusion with the time domain sampling frequency matt_w DSP 4 05-06-2008 07:31 PM
what's the different variance from time domain and frequency domain? [email protected] DSP 4 09-30-2007 05:11 AM
Estimating time domain peakedness from frequency domain information Ksen DSP 24 08-29-2006 03:52 PM
equivalent operations in the time-domain & the frequency-domain theColdest DSP 4 03-12-2005 08:57 PM


All times are GMT +1. The time now is 04:10 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved