# Re: fftw and derivative. once again

Started by January 9, 2011
```On Sunday, January 9, 2011 8:11:59 AM UTC-5, ntiy wrote:
> Hi DSP guys.
>
> I know there were a few threads with this question already. I looked
> through them and I am still stuck. Can't figure out what could be wrong and
> my eyes and head hurt. So, I thought may be someone helps...
>
> I am trying to compute derivative with fftw. Here are key points of my C
> code (well, that's actually the whole code):

...

I know you asked for help, but maybe you can help me. The FT (within its limitations) gives the spectrum of a time sequence. The FT^-1 goes the other way. Neither operation is explicitly part of differentiation. Where does the derivative come from?

If you obtain the spectrum, then advance each component pi/2 radians and multiply its amplitude by an amount proportional to frequency, you would have the spectrum of the differentiated signal. Then an inverse transform would yield the derivative of the original sequence (assuming that a discrete sequence can have a derivative). You apparently have a simpler way. Would you please explain it?

Jerry
```
```On Jan 9, 12:26&#2013266080;pm, Jerry Avins <j...@ieee.org> wrote:

> If you obtain the spectrum, then advance each
>component pi/2 radians and multiply its amplitude
>by an amount proportional to frequency, you
>would have the spectrum of the differentiated signal.

But the OP says

"I take function, convert it to F-space, multiply
F-components by -om^2"

which seems to be multiplying by an amount
proportional to the square of the frequency.
Perhaps this is why the answer does not seem
right?

```
```On 01/09/2011 11:22 AM, dvsarwate wrote:
> On Jan 9, 12:26 pm, Jerry Avins<j...@ieee.org>  wrote:
>
>> If you obtain the spectrum, then advance each
>> component pi/2 radians and multiply its amplitude
>> by an amount proportional to frequency, you
>> would have the spectrum of the differentiated signal.
>
> But the OP says
>
> "I take function, convert it to F-space, multiply
> F-components by -om^2"
>
> which seems to be multiplying by an amount
> proportional to the square of the frequency.
> Perhaps this is why the answer does not seem
> right?
>
Which sounds like double differentiation.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" was written for you.
See details at http://www.wescottdesign.com/actfes/actfes.html
```
```>On Jan 9, 12:26=A0pm, Jerry Avins <j...@ieee.org> wrote:
>
>> If you obtain the spectrum, then advance each
>>component pi/2 radians and multiply its amplitude
>>by an amount proportional to frequency, you
>>would have the spectrum of the differentiated signal.
>
>But the OP says
>
>"I take function, convert it to F-space, multiply
>F-components by -om^2"
>
>which seems to be multiplying by an amount
>proportional to the square of the frequency.
>Perhaps this is why the answer does not seem
>right?
>
>

Sorry, I should have mentioned. Of course in this example I multiply by
om^2 to find second derivative.
```