Digital Signal Processing Reference
In-Depth Information
yk=sin(2*pi*f*k) + 0.1*randn();
xk = m_rem(yk,pk);
// printf(" xk = %.3e yk = %.3e \n",xk,yk);
// getch();
fprintf(fp_write,"%.2f%.2f%.2f%.2f%.2f\n",pk[0],pk[1],pk[2],xk,yk);
}
// printf(" finish \n");
fclose(fp_write);
}
void mat_p( float *,int,int);
void mat_mul( float *, float *, float *);
void mat_mul_col( float *, float *, float *);
void mat_mul_row( float *, float *, float *);
void mat_trps( float *, float *);
void mat_eql( float *, float *);
void ary_eql( float *, float *);
void mat_unt( float *);
void mat_scl( float *, float);
void ary_scl( float *, float);
void mat_mul_row_col( float *, float *, float *);
void mat_add( float *, float *, float *);
void ary_add( float *, float *, float *);
float mat_dot( float *, float *);
float randn(void);
void mat_mul( float *some_A, float *some_B, float *some_C)
{
int max_row_A = 3, max_col_A = 3;
int max_col_B = 3;
int col,row,k,index_A,index_B;
float val_A,val_B,sum;
for ( row = 0; row
<
max_row_A; row++)
{
for ( col = 0; col
<
max_col_B; col++)
{
sum = 0;
for(k=0;k
<
max_col_A; k++)
{
index_A = max_col_A*row + k;
Search WWH ::




Custom Search