Question
Activities Modify the Addition.java class ( or some other program as you see fit , or start from scratch) to implement Shannon's Theorem to compute
Activities
Modify the
Addition.java
class (
or some other program as you see fit
, or start from scratch) to implement Shannon's
Theorem to compute the Capacity "
C" (
maximum data rate), of a communications channel, given the Bandwidth "
B"
,
and Signal-to-Noise Ratio "
SNR"
. Output your results using the
JOptionpane.showMessageDialog()
method (also use
JOptionpane for input of values). The maximum data rate
should be returned as a deci
mal number with two decimal
places of precision (clues may be fou
nd in your text book or the "Really big
index" regarding decimal places to
display).
Function to apply Shannon's Theorem for capacity:
MDR = (H) [log2(1 + s)]
Where:
MDR
= maximum data rate
H
= bandwidth in Herz
S/N
= signal to noise (SNR)
Assume
S/N
is in decibels
dB
. The signal-to-noise ratio uses a signal power
S
and the noise power
N
,
the signal-to-noise ra
tio is shown as
S/N.
The ratio itself is not quoted;
rather the quantity 10 log(10)
S/N
is given. These units are called decibels
dB
. An
S/N
ratio of 10 is
10 dB
, a ratio of 100 is
20 dB
,
a ratio of 1000 is
30 dB
...
So ...
Let x = log2(1+SNR) then MDR = (H) * (x)
Now solve for x ???
Documentation
Make sure you run javadoc against your source code and
have the documentation files placed in a folder called
"docs".
The command in a DOS window woul
d be >javadoc -d docs *.java
... assuming all source files are in the de
fault folder where you execute javadoc.
Testing
Your program should be thoroughly unit
tested using the JUnit testing fram
ework. You must use the provided
skeleton for Junit test classes and add the Junit jar file as
an external JAR to your Eclipse Project (ensure you follow
the test class naming conventions implemented in the skel
eton classes). The skeleton
classes (ShannonsSample) and
test classes are not intended to implement your requirement
s for this lab. Place your sour
ce code in a package named
network and your JUnit test classes (AllTests.j
ava and Test_ShannonsTheorm) in a package named
networktest. Make sure among other te
sts, you include a test for the standard
parameters of a telephone line. The
following zip file contains a sample to illustra
tes the setup for your project, (see attached
ShannonsSample.zip
).
Tests should consist not only of va
lid data but also invalid data.
You may follow the directory structure of the provided sa
mple. The "junit.jar" file must be in your "classpath"
environment variable, or
defined thru your IDE tool
. My class path was set as pe
r the following statements. (you
may pick the latest version of Junit if you wish)
set JUNIT_HOME=c:\javaaddons\junit3.8.1
set classpath=.;%JUNIT_HOME%\junit.jar
Each IDE handles additions to
the classpath differently, refer to th
e documentation for your IDE tool.
UML:
Shannons Theorem Theorem bandwidth double signal Tol oise double Class to implement Shannon's Theorem for network capacity. This class contains attributes forthe signal to +getBandwidth0 double ue and the bandwidth value. It s both accessors and modifiers for those a butes noise latio va also contain getMaximumDataRate( hentz double, signalToNoise double double getset pattern). You must also factor the netwo capacity caluciation into its own method. +getMaximum Data Rate0 double getiMaximumDataRate0. +getSignalToNoise0 double The main0 method instantiates the class ShannonsTheorem. +setBandwidth h double void +setSignalToNoise( snr double): void eg. ShannonsTheorem shannons a new ShannonsTheore Theorem +Shannons Theorem0 +toString0 String This creates an instance of the class, making instance members available from the within the static ma method The calculation of maximum data rate can be found in the method getiMaximumDataRate(double. double) HINT The method get MaximumDataRate0 (absent of any arguments) has been overriden by the method that accepts arguments. The implementation of the public method would invoke the private method passing the instance values for bandwidth and signalto-noise. MORE H) [l og2 Where MDR maximum data rate bandwidth in Herz signal to noise (SNR SIN e.g. (hz math math.log(2) Notice that e only static member(s) are e maino method As a standard for all java classes. a toS go method has been overridden and should provide a meaningful string that Iepresents the class. Quite often this involves returning the attributes and their values in some meaningful formatStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started