Define rect().
Choose
cycles of the modulation
frequency.
This is the continuous-time signal, x(t).
We use Π() to limit the time duration of the signal,
sincee cannot integrate a sinusoid from minus infinity to infinity.
The Fourier transform of this truncated funtion will then
not be exactly the same as for the infinite length function .
Estimate the time range, tmax,
multiple of one over the filter bandwidth.
Next, find the Fourier transform of the signal.
In some cases, the
sin/cos form
Estimate the frequency range, wmax,
Since it is not possible to simulate the impulse train
it will be approximated with unit-area rectangular pulses of width 0.1 and height 10,
with period Ts.
The sampled signal xs(t) is approximated as:
The spectrum of the sampled signal is
which can be approximated by:
which, for faster computation in Mathcad, can be approximated by
Finally,
the output of an A/D converter followed by a D/A converter can
be simulated as:
Random variables.
Uniform pdf, pv(v) where y is uniformly distributed between 0 and 2.
The CDF, Fx(x) where is.
Example Gaussian pdf with mean 1 and sigma =1.
mean of -2.
Uniform pdf, pv(v), where v is uniformly distributed between 0 and 2.
Next,
create random data with same distribution as above
Find the mean of the random data:
And compute the second moment VVsec for the random data.
(Add a new Mathcad formula below to compute
(Add a new Mathcad formula below to compute
When signals are digitized using an analog-to-digital converter (ADC), the signals are quantized
in addition to being sampled in time.
The effect of quantization is the same as adding a random error to a signal.
In the case of an 8-bit ADC, the signals are quantized into 256 discrete levels, and L=255 steps,
ranging from the min to max of the ADC voltage range.
selects the closest level to the analog voltage that is being digitized.
To implement quantization in mathcad, the following function is used.
The example for a 2 bit dac, nbits=2, is plotted.
Returning to the sampled sinusoid,
let us now sample again but without the Π() gate,
with quantization and a bit higher sample rate.
.
Sampling frequency fs samples/second.
Sampling period Ts seconds
Set number of points to a power of two for the FFT.
(The equation is a bit cumbersome.)
This is actual width of time to be sampled
Finally, xs
It is a vector consisting of the value of x(t) at
npts equally spaced time intervals, spaced Ts apart.
The quantized signal is then
The quantized error is then
Find the statistics of the quantization error.
Quantization step size
.
experimental value
(Add a new Mathcad formula below to compute
Time Averages Using Integrals
Consider the problem of computing an average hourly pay rate.
Suppose a worker is paid $10/hr for the first hour, $20/hr for the next 4 hours,
and $10/hour for the last 3 hours of a day.
We could write the function in Mathcad as:
The average hourly rate from time 0 to time T=8 can be computed as