Monday, February 20, 2012

Maximum Data Rate of a Channel in Java


Summary
Calculate the maximum data rate of a channel according to Shannon and Nyquist.  

Description
This tutorial shows how to calculate the maximum data rate of a channel using static methods in Java.  The two following formulas being used are:

Nyquist
maximum data rate = 2B log2 V
B is bandwidth
V is levels

This is represented by "MaximumDataRates.NyquistMdr(bandwidth, levels)"

Shannon
maximum number of bits/sec = B log2 (1 + S/N)
This is represented by "MaximumDataRates.ShannonMdr(decibels, bandwidth)"
B is bandwidth
S/N is signal-to-noise ratio


Before we begin
For the tutorial, take a look at the following:

Shannon-Hartley theorem (wikipedia) - A more in-depth description.

Maximum Data Rate (in Java)


public class MaximumDataRates {

// private no-arg constructor
// driving home the point
private MaximumDataRates(){

}

static double NyquistMdr(double bandwidth, double levels){

return(2 * bandwidth * (Math.log(levels) / Math.log(2)));
}

static double ShannonMdr(double decibels, double bandwidth){

return (bandwidth * Math.log((FindSignalToNoise(decibels) + 1)) / Math.log(2));
}

static double FindSignalToNoise(double decibels){
return Math.pow(10, (decibels / 10));
}

}


No comments:

Post a Comment