How to compute derivatives of discrete data in Matlab?

Status
Not open for further replies.

smithchart

Member level 5
Joined
Aug 10, 2004
Messages
89
Helped
24
Reputation
48
Reaction score
19
Trophy points
1,288
Activity points
1,308
matlab derivative of data

Hello:

I need to compute derivatives of complex discrete data in Matlab, anyone here can tell me how to perform it? (Build-in functions?)

For example, I have the following frequency dependent data:

f X
f1 x1-jy1
f2 x2+jy2
f3 x3-jy3
...
....

Where fi,xi and yi are real numbers with particular value. How should I compute

f*dx/df in matlab?

Thanks in advance.
 

matlab discrete derivative

Hi,

cant you use diff instruction and then use array multiplication?

brmadhukar
 

discrete derivative matlab

Hello, brmadhukar:

Thank you for your reply.

The function diff() in matlab can only operate on real number arrary. Initially I had thought that the we cannot deal with complex number the same way we with the real number, thus posted the help here.

Later, I searched some materials on this topic and found that as long as one of the variable is real(here in my case is frequency:f), the finite difference that apply to real numbers still can apply to complex number(effectively treat real part and imaginary part of the complex number separately).

Thus, I can approximate dX/df=diff(X)./diff(f) assuming X is complex discrete data and the result will have a array length of (n-1), assuming the original array X has a length of n.

Regards,
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…