8-ma’ruza. Mavzu: Signal yetakchi garmonikalarini ajratish algoritmi. Spektral tahlil Reja: Umumiy tushunchalar


Download 263.69 Kb.
bet4/4
Sana02.11.2023
Hajmi263.69 Kb.
#1739211
1   2   3   4
Bog'liq
signallar-8-ma\'ruza

Natija

2-Misol. y=x2+2 funksiya uchun Furye qatori garmonikalarining eng katta amplitudasini aniqlash dasturini tuzing.
Dastur kodi
#include
#include
using namespace std;
double f(double x)
{
return x*x+2;
}
int main()
{
float a,b,h,S=0, x;
cin>>a>>b;
int nn=30;
h=(b-a)/nn;
x=a;
for(int i=0; i
{
x+=h;
S+=f(x); //S=S+x*x+2
}
S*=h;
double a0=S/M_PI;
cout<
x=a;
double an=0;
double bn=0;
for(int n=1; n<=10; n++)
{
for(int i=0; i
{
x+=h;
an+=f(x)*cos(n*x);
bn+=f(x)*sin(n*x);
}
an*=cos(n*x)*h/M_PI;
bn*=sin(n*x)*h/M_PI;
An=sqrt(an*an+bn*bn);
maxxA=0;
if(maxxA
}
Cout<
Download 263.69 Kb.

Do'stlaringiz bilan baham:
1   2   3   4




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling