65.9K
CodeProject is changing. Read more.
Home

Simulating Signal recovery

starIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIconemptyStarIcon

1.50/5 (7 votes)

Jun 11, 2008

CPOL
viewsIcon

25294

downloadIcon

486

NRZ, Bipolar AMI, M Level, PSK, FSK, ASK

Introduction

this application needs input a bit string, deltha and sample to get the recovered signal.

Using the code

class classGrafica has 19 methods NRZ, BIPOLAR, ASK, PSK...

NRZ method

           
public PointPairList NRZ()
{
PointPairList ptosnrz = new PointPairList();
int i;
int j;
int val;
double[] punto = new double[lenght];
for (i = 0; i < lenght; i++)
{
punto[i] = Convert.ToInt32(bits[i].ToString());
}
double y;
val = 0;
for (j = 0; j < lenght; j++)
{
y = (double)punto[j] * 5;
for (i = 0; i < muestra; i++)
{
ptosnrz.Add(val, y);
val++;
}
}
return ptosnrz;
}

Bipolar Method

 
public PointPairList BIPOLAR()
{
PointPairList ptosbipolar = new PointPairList();
int i;
int j;
int val;
double[] punto = new double[lenght];
for (i = 0; i < lenght; i++)
{
punto[i] = Convert.ToInt32(bits[i].ToString());
}
double y;
int p;
val = 0;
p = 2;
for (j = 0; j < lenght; j++)
{
y = (double)punto[j];
if (y == 1)
{
y = Math.Pow(-y, p);
p++;
}
y = y * 5;
for (i = 0; i < muestra; i++)
{
ptosbipolar.Add(val, y);
val++;
}
}
return ptosbipolar;
}

In the source code are everything to make it works...