SciLib.SP.Comm
Class Encode

java.lang.Object
  extended by SciLib.SP.Comm.Encode

public final class Encode
extends java.lang.Object

This class contains some methods to perform the encoding techniques.


Constructor Summary
Encode()
           
 
Method Summary
static void AM(double na, double fc)
          Plot the result of modulating by Amplitude-Modulation technique.
static vector AM(double na, double fc, vector x, vector t, boolean plot)
          Generate the modulating signal by Amplitude-Modulation technique.
static bitStream AMIData(int[] signal)
          Recover digital data from bipolarAMI signal.
static vector ASK(bitStream bits, boolean plot)
          Plot the result of modulating by Amplitude-shift keying technique.
static int[] bipolarAMI(bitStream bitstr, boolean plot)
          Generate a signal from a bitStream data using bipolarAMI technique.
static int[] differentialManchester(bitStream bitstr, boolean plot)
          Generate a signal from a bitStream data using differentialManchester technique.
static bitStream differentialManchesterData(int[] signal)
          Recover digital data from differentialManchester signal.
static bitStream directSeq(bitStream in, bitStream bseq)
          Generate a direct sequence signal.
static vector FSK(bitStream bits, boolean plot)
          Plot the result of modulating by Frequency-shift keying technique.
static bitStream inverseDirectSeq(bitStream s, bitStream bseq)
          Recover data from a direct sequence signal.
static int[] Manchester(bitStream bitstr, boolean plot)
          Generate a signal from a bitStream data using Manchester technique.
static bitStream ManchesterData(int[] signal)
          Recover digital data from Manchester signal.
static int[] NRZI(bitStream bitstr, boolean plot)
          Generate a signal from a bitStream data using NRZI technique.
static bitStream NRZIData(int[] signal)
          Recover digital data from NRZI signal.
static int[] NRZL(bitStream bitstr, boolean plot)
          Generate a signal from a bitStream data using NRZL technique.
static bitStream NRZLData(int[] signal)
          Recover digital data from NRZL signal.
static void PM(double Ac, double np, double fc)
          Plot the result of modulating by Phase-Modulation technique.
static vector PM(double Ac, double np, double fc, vector x, vector t, boolean plot)
          Genarate the modulating signal by Phase-Modulation technique.
static int[] pseudoternary(bitStream bitstr, boolean plot)
          Generate a signal from a bitStream data using pseudoternary technique.
static bitStream pseudoternaryData(int[] signal)
          Recover digital data from pseudoternary signal.
static vector PSK(bitStream bits, boolean plot)
          Plot the result of modulating by Phase-shift keying technique.
static vector QPSK(bitStream bits, boolean plot)
          Plot the result of modulating by Quadrature Phase-shift keying technique.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encode

public Encode()
Method Detail

NRZL

public static int[] NRZL(bitStream bitstr,
                         boolean plot)
Generate a signal from a bitStream data using NRZL technique.

Parameters:
bitstr - A bitStream
plot - An option, true for to plot the signal
Returns:
An integer array that contains the signal voltage levels

NRZLData

public static bitStream NRZLData(int[] signal)
Recover digital data from NRZL signal.

Parameters:
signal - An integer array that contains NRZI pulses
Returns:
A bitStream that represents digital data

NRZI

public static int[] NRZI(bitStream bitstr,
                         boolean plot)
Generate a signal from a bitStream data using NRZI technique.

Parameters:
bitstr - A bitStream
plot - An option, true for to plot the signal
Returns:
An integer array that contains the signal voltage levels

NRZIData

public static bitStream NRZIData(int[] signal)
Recover digital data from NRZI signal.

Parameters:
signal - An integer array that contains NRZI pulses
Returns:
A bitStream that represents digital data

bipolarAMI

public static int[] bipolarAMI(bitStream bitstr,
                               boolean plot)
Generate a signal from a bitStream data using bipolarAMI technique.

Parameters:
bitstr - A bitStream
plot - An option, true for to plot the signal
Returns:
An integer array that contains the signal voltage levels

AMIData

public static bitStream AMIData(int[] signal)
Recover digital data from bipolarAMI signal.

Parameters:
signal - An integer array that contains AMI pulses
Returns:
A bitStream that represents digital data

pseudoternary

public static int[] pseudoternary(bitStream bitstr,
                                  boolean plot)
Generate a signal from a bitStream data using pseudoternary technique.

Parameters:
bitstr - A bitStream
plot - An option, true for to plot the signal
Returns:
An integer array that contains the signal voltage levels

pseudoternaryData

public static bitStream pseudoternaryData(int[] signal)
Recover digital data from pseudoternary signal.

Parameters:
signal - An integer array that contains pseudoternary pulses
Returns:
A bitStream that represents digital data

Manchester

public static int[] Manchester(bitStream bitstr,
                               boolean plot)
Generate a signal from a bitStream data using Manchester technique.

Parameters:
bitstr - A bitStream
plot - An option, true for to plot the signal
Returns:
An integer array that contains the signal voltage levels

ManchesterData

public static bitStream ManchesterData(int[] signal)
Recover digital data from Manchester signal.

Parameters:
signal - An integer array that contains Manchester pulses
Returns:
A bitStream that represents digital data

differentialManchester

public static int[] differentialManchester(bitStream bitstr,
                                           boolean plot)
Generate a signal from a bitStream data using differentialManchester technique.

Parameters:
bitstr - A bitStream
plot - An option, true for to plot the signal
Returns:
An integer array that contains the signal voltage levels

differentialManchesterData

public static bitStream differentialManchesterData(int[] signal)
Recover digital data from differentialManchester signal.

Parameters:
signal - An integer array that contains pseudoternary pulses
Returns:
A bitStream that represents digital data

ASK

public static vector ASK(bitStream bits,
                         boolean plot)
Plot the result of modulating by Amplitude-shift keying technique.

Parameters:
bits - A bitStream
plot - An option, true for to plot the signal

FSK

public static vector FSK(bitStream bits,
                         boolean plot)
Plot the result of modulating by Frequency-shift keying technique.

Parameters:
plot - An option, true for to plot the signal
bits - A bitStream

PSK

public static vector PSK(bitStream bits,
                         boolean plot)
Plot the result of modulating by Phase-shift keying technique.

Parameters:
plot - An option, true for to plot the signal
bits - A bitStream

QPSK

public static vector QPSK(bitStream bits,
                          boolean plot)
Plot the result of modulating by Quadrature Phase-shift keying technique.

Parameters:
bits - A bitStream
plot - An option, true for to plot the signal

AM

public static void AM(double na,
                      double fc)
Plot the result of modulating by Amplitude-Modulation technique.

Parameters:
na - Modulation index
fc - Frequency of the carrier

AM

public static vector AM(double na,
                        double fc,
                        vector x,
                        vector t,
                        boolean plot)
Generate the modulating signal by Amplitude-Modulation technique.

Parameters:
na - Modulation index
fc - Frequency of the carrier
x - A vector that was normalized to unity amplitude
t - The time vector that has the same length as x
plot - An option, true for to plot the signal

PM

public static void PM(double Ac,
                      double np,
                      double fc)
Plot the result of modulating by Phase-Modulation technique.

Parameters:
Ac - The carrier amplitude
np - Phase Modulation index
fc - Frequency of the carrier

PM

public static vector PM(double Ac,
                        double np,
                        double fc,
                        vector x,
                        vector t,
                        boolean plot)
Genarate the modulating signal by Phase-Modulation technique.

Parameters:
Ac - The carrier amplitude
np - Phase Modulation index
fc - Frequency of the carrier
x - A vector that was normalized to unity amplitude
t - The time vector that has the same length as x
plot - An option, true for to plot the signal
Returns:
A vector

directSeq

public static bitStream directSeq(bitStream in,
                                  bitStream bseq)
Generate a direct sequence signal.

Parameters:
in - A bitStream, input data
bseq - A bitStream, binary pattern
Returns:
an output bitStream

inverseDirectSeq

public static bitStream inverseDirectSeq(bitStream s,
                                         bitStream bseq)
Recover data from a direct sequence signal.

Parameters:
s - A bitStream, the direct sequence signal
bseq - A bitStream, binary pattern
Returns:
an output bitStream, the original data