HP Prime Forum

Full Version: CAS fourier_an ...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello friends,

I try to use the new Funktion "fourier_an", "..._bn" or "..._cn" on CAS.
The function I try to approximate is a rectangle signal.

T=10ms
f(x)= 10V = û
a=0
n=1...6

In CAS: fourier_bn(Expr,Var,T,n,a)
so I type fourier_bn(10,x,10,1,0) for b1

Normally the result is:
b1=û*2/PI=20/PI
b2=0
b3=û*2/(3*PI)=20/(3*PI)
b4=0
b5=û*2/(5*PI)=20/(5*PI)
b6=0
a0=û/2=5

But with HP Prime calculator:
b1=b2=b3=b4=b5=b6=0
a0=10
The results are compleately wrong!!!

Is there a mistake in using the function on my side or is it an bug?

Thank you in advance for your help.

REF
Hi!

I assume that your function has a value of 10 V for the first 10 ms, and 0 V for the next 10 ms; in that case the period is 20 ms.

So, if you use fourier_an() and fourier_bn() with a function whose value is: 10 if x<10, and 0 if x>=10, and use 20 as the period, you'll get the correct answer.

a0=5
b1=20/PI
b2=0
b3=20/(3*PI)
...
Can you show me how to type in?

fourier_an(10,x,20,0,0)
fourier_bn(10,x,20,1,0)
.
.
.

Is this right?

REF

(18-01-2016 06:06 PM)JMB Wrote: [ -> ]Hi!

I assume that your function has a value of 10 V for the first 10 ms, and 0 V for the next 10 ms; in that case the period is 20 ms.

So, if you use fourier_an() and fourier_bn() with a function whose value is: 10 if x<10, and 0 if x>=10, and use 20 as the period, you'll get the correct answer.

a0=5
b1=20/PI
b2=0
b3=20/(3*PI)
...
Please see the following screen capture:
[attachment=63]

The function: 10 if x<10, 0 if x >=10 is entered by pressing the template key, and then selecting the 5th icon of the 1st row:
[attachment=62]
(29-04-2016 05:46 PM)JMB Wrote: [ -> ]Please see the following screen capture:


The function: 10 if x<10, 0 if x >=10 is entered by pressing the template key, and then selecting the 5th icon of the 1st row:

Thank you very much!!! It works fine. :-)
Reference URL's