Muhammad Al-Xorazmiy nomidagi
Toshkent axborot texnologiyalari universiteti
3-laboratoriya ishi
Algoritmnlarni loyihalash
Mavzu: Raqamli axborotlarni qayta ishlashda Fure usuli va dinamik dasturlash yo‘li
Talaba: Jalilov Bekzod
TATU - 2022
12 – variant
1-vazifa
1-vazifa
Jadval ko’rinishida berilgan funksiyalarni Furye qatori asosida raqamli signallar yetakchi garmonikalarini aniqlash usuli bilan analitik ko’rinishda ifodalang. Algoritmini tuzib, dasturlash tilida dastur kodini yozing va natija oling.
1-vazifaga doir variantlar:
Жалилов Бекзоджон
#include
#include
using namespace std;
int main(){
double t1=0, t[21] , y_m[21 ], a[10] , b[10] , c[10] , T , sum_f=0 , h , v;
double f[21]={-7.21912, -12.3075, 13.682394, 18.89654, 6.895312, -12.4514, 49.89612, 2.479463, 11.73962, 42.76255, 7.215242, 12.90915, -3.67575, -18.8958 -5.90188, 12.4183, 9.899866, -42.42739, 71.17605, 12.763413, -7.211375};
cout<<"t va unga mos f ni kiriting";
for(int i=0 ; i<21 ; i++ ){
t[i]=t1;
t1+=0.000005;
}
T = t[20];
h = T / 20;
cout<for(int i=1 ; i<20 ; i++)
sum_f+=f[i];
a[0] = 2 * ( ( f[0] + f[20] ) / 2 + sum_f ) * h / T;
b[0] = 0;
for(int k=1 ; k<11 ; k++){
a[k] = f[0]*sin(k*M_PI*h/T) - f[20]*sin(2*k*M_PI*(T-(h/2))/T);
for(int i=1 ; i<20 ; i++)
{
v=i*h;
a[k] += f[i]*( sin(2*M_PI*k*(v+(h/2))/T)-sin(2*M_PI*k*(v-(h/2))/T) );
}
a[k]/=(M_PI*k);
cout<<"a"<}
cout<for(int k=1 ; k<11 ; k++){
b[k] = f[0]* (cos(k*M_PI*h/T) -1) + f[20]*( 1-cos(2*k*M_PI*(T-(h/2))/T) );
for(int i=1 ; i<20 ; i++)
{
v=i*h;
b[k] += f[i]*( cos(2*M_PI*k*(v+(h/2))/T)-cos(2*M_PI*k*(v-(h/2))/T) );
}
b[k]/=(-1*M_PI*k);
cout<<"b"<
}
c[0]=0;
cout<<" \n\n";
for(int i=1;i<11;i++){
c[i]=sqrt(a[i]*a[i]+b[i]*b[i]);
cout<<"c"<}
// c1 -> max;
double fi = atan(a[1]/b[1]);
cout<<"\n\n model qiymatlar va ularning xatoliklari : "<for(int i=0 ; i<21 ; i++){
v=h*i;
y_m[i]=c[1]*sin(2*M_PI*v/T + fi );
cout<<"y"<}
}
2-vazifa
3 -vazifa 1 va 2
3.
3 . 1
3. 2
3. 4 Excel dasturida olingan natija
21>20>11>20>11>20>21>
Dostları ilə paylaş: |