Home > Back-end >  Why a code written on the codeblock or display an error
Why a code written on the codeblock or display an error

Time:09-21

C: \ Users \ DELL \ Desktop \ LMS \ the main C | | 20 error: lvalue required as increment operand |
C: \ Users \ DELL \ Desktop \ LMS \ the main C | | 21 error: lvalue required as increment operand |
C: \ Users \ DELL \ Desktop \ LMS \ the main C | | 30 error: expected '; 'before' for '|
C: \ Users \ DELL \ Desktop \ LMS \ main 42 C | | error: expected '; 'before') 'token |
C: \ Users \ DELL \ Desktop \ LMS \ main 42 C | | error: expected statement before the ') 'token |
C: \ Users \ DELL \ Desktop \ LMS \ main 44 C | | warning: control reaches the end of a non - void function




#include
#include
#include
0.01//# define beta convergence rate
21//# define N the order of the filter
# define NS//number of 40 samples
8000//# define the Fs from freqency
# define PI 3.1415926
# define DESIRED 2 * cos (2 * PI * T * 1000/Fs)//DESIRED signal
# define whose sin (2 * PI * T * 1000/Fs)//NOISE signal

Int main ()
{
Long I, T;
Double D, Y, E;
Double W [N + 1)=0.0} {;
Double X [N + 1)=0.0} {;
Y_out desired FILE * and * and * error;
Desired=fopen (" desired ", "W++");//file for desired samples
Y_out=fopen (" Y_out W++);//the file for the output samples
Error=fopen (" error ", W++);//file for error samples

For (T=0; T & lt; NS. T++)//start the adaptive algorithm
{
X [0]=NOISE;//new niose sample
D=DESIRED;//desired signal
Y=0;//filter 'output set to zero
For (I=0; I & lt;=N; I++)
[I] * X + Y=(W [I]);//calculate the filter output
E=D - Y//calculate the error signal
For (I=N; I & gt;=0, I -)
{
W [I] +=(beta * E * X [I]);//update the filter coefficients
If (I.=0)
[I]=X X [I - 1);//update the data sample

}
Fprintf (desired, "\ n % % 10 g f," T/Fs (float), D);
Fprintf (Y_out, "\ n % % 10 g f," (float) T/Fs, Y);
Fprintf (error, "\ n % % 10 g f, T/Fs (float), E);
}
The fclose (desired);
Fclose (Y_out));
The fclose (error);
}

CodePudding user response:

E=D - Y the lack of a semicolon here, this is a mistake, the other you see again

CodePudding user response:

E=D - Y no error, is where I mark red error,

CodePudding user response:

#include
#include
#include
0.01//# define beta convergence rate
21//# define N the order of the filter
# define NS//number of 40 samples
8000//# define the Fs from freqency
# define PI 3.1415926
# define DESIRED 2 * cos (2 * PI * T * 1000/Fs)//DESIRED signal
# define whose sin (2 * PI * T * 1000/Fs)//NOISE signal

Int main ()
{
Long I, T;
Double D, Y, E;
Double W [N + 1)=0.0} {;
Double X [N + 1)=0.0} {;
Y_out desired FILE * and * and * error;
Desired=fopen (" desired ", "W +");//file for desired samples
Y_out=fopen (" Y_out ", "W +");//the file for the output samples
Error=fopen (" error ", "W +");//file for error samples
For (T=0; T & lt; NS. T++)//start the adaptive algorithm
{
X [0]=NOISE;//new niose sample
D=DESIRED;//desired signal
Y=0;//filter 'output set to zero
For (I=0; I & lt;=N; I++)
[I] * X + Y=(W [I]);//calculate the filter output
E=D - Y;//calculate the error signal
For (I=N; I & gt;=0; I -)
{
W [I] +=(beta * E * X [I]);//update the filter coefficients
If (I.=0)
[I]=X X [I - 1);//update the data sample

}
Fprintf (desired, "\ n % % 10 g f," T/Fs (float), D);
Fprintf (Y_out, "\ n % % 10 g f," (float) T/Fs, Y);
Fprintf (error, "\ n % % 10 g f, T/Fs (float), E);
}
The fclose (desired);
The fclose (Y_out);
The fclose (error);
}

CodePudding user response:

"W +" not w++

CodePudding user response:

Nor W++ question,
My teacher give me something for a moment, after the file added a little Spaces,
Change after an error prompt has changed, but still error

C: \ Users \ DELL \ Desktop \ \ the main 1 C | | 23 error: stray '\ 224' in the program |
C: \ Users \ DELL \ Desktop \ \ the main 1 C | | 23 error: expected expression before ') 'token |
C: \ Users \ DELL \ Desktop \ \ the main 1 C | | 19 warning: variable 'Y_out set but not 2 [- Wunused - but - set - variable] |
C: \ Users \ DELL \ Desktop \ \ the main 1 C | | 18 warning: variable 'desired' set but not 2 [- Wunused - but - set - variable] |
C: \ Users \ DELL \ Desktop \ \ the main 1 C | | 17 warning: unused variable 'X' [- Wunused - variable] |
C: \ Users \ DELL \ Desktop \ \ the main 1 16 C | | warning: unused variable 'W' [- Wunused - variable] |
C: \ Users \ DELL \ Desktop \ \ the main 1 15 C | | warning: unused variable 'E' [- Wunused - variable] |
C: \ Users \ DELL \ Desktop \ \ the main 1 15 C | | warning: unused variable 'Y' [- Wunused - variable] |
nullnullnullnullnullnullnullnullnullnullnull
  • Related