Sunday, March 23, 2014

NETWORK DEVICES

NETWORK DEVICES
Inter networking devices are products used to connect networks.  As computer networks grow in size and complexity, so do the inter networking devices used to connect them. Network devices are components used to connect computers or other electronic devices together so that they can share files or resources like printers or fax machines. Devices used to setup a Local Area Network (LAN) are the most common type of network devices used by the public. A LAN requires a hub, router, cabling or radio technology, network cards, and if online access is desired, a high-speed modem. Happily this is much less complicated than it might sound to someone new to networking. In a network, one computer is designated as the server, and the others, clients. The server is connected to an external hub, which the clients are also connected to. Now that the computers each have one foot in a common electronic door (the hub), they can use the hub to pass signals back and forth. To direct these signals, the hub contains a device known as a router. The router is the equivalent of an electronic traffic cop that handles data traffic between the computers. Every type of network device was developed to solve a problem. Network devices operate at different layers of the OSI model.
The Purposes of having devices
b        First, they allow a greater number of nodes to be connected to the network.
b        Second, they extend the distance over which a network can extend.
b        Third, they localize traffic on the network.
b        Fourth, they can merge existing networks.
b        Fifth, they isolate network problems so that they can be diagnosed more easily. 
Network Devices Types
Network devices are four types .They are
1-Hubs          2- Rutter’s       3- Switches         4-Routers
Hub
A Hub is a multiport repeater. It is normally used to create connections between stations in a physical star topology.
Multi-port repeaters are often called hubs. Hubs are very common internetworking devices. Generally speaking, the term hub is used instead of repeater when referring to the device that serves as the center of a star topology network

This is a hardware device that is used to network multiple computers together. It is a central connection for all the computers in a network, which is usually Ethernet-based. Information sent to the hub can flow to any other computer on the network. If you need to connect more than two computers together, a hub will allow you to do so. If you only need to network two computers together, a simple crossover Ethernet cable will do the trick.
Types of Hub
There are three types of hubs. These hubs include active, passive hub, and intelligent hub.
Active hubs
 Active hubs act as a connector between two regions. Amplify or repeat signals that pass to correct data transmission errors or help troubleshoot network problems. . This type of hub is quite similar to that of the passive hub but can perform the additional tasks. Active hubs are those hubs that can work as connector between two regions but also has ability to regenerate the information with the help of strong electrical signals. It is also called as the multi -port repeater. It helps in the communication and can upgrade the properties of the signals before delivery.
Passive hub
Merely connects cables on a network and provides no signal regeneration. Passive hubs act like a bridge allowing information to be received. Passive hubs simply pass on the data they receive on the network. Passive hub does not perform any particular function but it just behaves like a bridge between the cables of connection and just receives the information and forwards it without any change in topology.
Intelligent hubs
Intelligent hubs are hubs that perform the tasks of both an active hub and a passive hub. Intelligent hubs have the most features of all. Intelligent hubs are very useful in managing larger .The third and the last type of the hub that can perform the both functions of the active and the passive hub is generally referred to as the intelligent hub. Basically this hub provides the opportunity to increase the speed of networking and also make the performance of the network efficient as compared to other devices. Addition to their specific work intelligent hubs can also perform the different functions that of routing, bridging etc.
 PURPOSE of Hub
A hub is a word with several meanings. It can mean the central part of a rectangular box whose work is to join network devices like computers together thus forming a one network segment. This enables the computers to directly communicate with each other. It can also be used to mean the central part of the bicycle wheel which provides a surface for attaching the spokes of bicycles. With the help of hubs we can create a home network easily. Hubs can also monitor the whole network in a real inexpensive way. It also provide the opportunity to the users to connect their old devices with their hub drives.  Network hub or repeater hub is a device for connecting multiple twisted pair or fiber optic Ethernet devices together and thus making them act as a single network segment. Hubs work at the physical layer (layer 1) of the OSI model. The device is thus a form of multiport repeater. Repeater hubs also participate in collision detection, forwarding a jam signal to all ports if it detects a collision. 


FUNCTION
The functions of a hub within a network is so they produce packets to the location of the service required to load or view a webpage or document. A hub is a network device that connects multiple computers on a LAN so they can communicate with one another, the rest of the network, and the Internet. All users connected to a hub share the available network bandwidth (unlike a switch, which provides full bandwidth to each computer). Hubs enable computers on a network to communicate. Each computer plugs into the hub with an Ethernet cable, and information sent from one computer to another passes through the hub. A hub can't identify the source or intended destination of the information it receives, so it sends the information to all of the computers connected to it, including the one that sent it. A hub can send or receive information, but it can't do both at the same time. This makes hubs slower than switches. Hubs are the least complex and the least expensive of these devices.
Network with a hub
Switches
A network switch is a small hardware device that joins multiple computers together within one local area network (LAN). Ethernet switch devices were commonly used on home networks before home routers became popular; broadband routers integrate Ethernet switches directly into the unit as one of their many functions. High-performance network switches are still widely used in corporate networks and data centers.
A Network Switch is a constituent of computer network that connects two network slices and/or two network devices (switches or routers) together. Switch can be termed as a network bridge with multiple ports which helps to process and route packets at data link layer of the OSI reference model. There are some switches which have capabilities to process data at the upper layers (network layer and above). Those switches are often termed as multilayer switches.





Two layer switch
Layer 2 refers to the Data Link layer of the commonly-referenced multilayered communication model, Open Systems Interconnection (OSI). The Data Link layer is concerned with moving data across the physical links in the network. In a network, the switch is a device that redirects data messages at the layer 2 level, using the destination Media Access Control (MAC) address to determine where to direct the message.
The Data-Link layer contains two sub-layers that are described in the IEEE-802 LAN standards:
·         Media Access Control (MAC) sub-layer
·         Logical Link Control (LLC) sub-layer
The Data Link layer ensures that an initial connection has been set up, divides output data into data frames, and handles the acknowledgements from a receiver that the data arrived successfully. It also ensures that incoming data has been received successfully by analyzing bit patterns at special places in the frames

Layer 2 Functionality

  • Store and Forward: The switch stores and verifies each packet before routing it.
  • Cut through: The switch verifies the portion of the packet header up to the hardware address of frame before it is forwarded. They may have to stick to the store and forward procedure if the outgoing port is engaged when the packet enters.
  • Fragment free: It is the methodology that tries to preserve the advantages of both cut through and store and forward functionalities. Fragment free verifies the first 64 bytes of the packet, wherein addressing details are saved. This is because; collisions should be determined within the first 64 bytes of the packet frame, so erroneous packet frames will not be routed.
  • Adaptive switching: This method automatically selects one of the above three methods depending upon traffic situation.
L 3 Switches
 Network device that forwards traffic based on layer 3 information at very high speeds. Traditionally, routers, which inspect layer 3, were considerably slower than layer 2 switches. In order to increase routing speeds, many "cut-through" techniques were used, which perform an "inspect the first packet at layer 3 and send the rest at layer 2" type of processing. Ipsilon's IP Switch and Cabletron's SecureFast switches were pioneers in cut-through switching.
A Layer 3 switch is a high-performance device for network routing. Layer 3 switches actually differ very little from routers. A Layer 3 switch can support the same routing protocols as network routers do. Both inspect incoming packets and make dynamic routing decisions based on the source and destination addresses inside. Both types of boxes share a similar appearance. A hybrid device is the latest improvement in internetworking technology. Combining the packet handling of routers and the speed of switching, these multilayer switches operate on both layer 2 and layer 3 of the OSI network model. The performance of this class of switch is aimed at the core of large enterprise networks. Sometimes called routing switches or IP switches, multilayer switches look for common traffic flows, and switch these flows on the hardware layer for speed. For traffic outside the normal flows, the multilayer switch uses routing functions. This keeps the higher overhead routing functions only where it is needed, and strives for the best handling strategy for each network packet.
Many vendors are working on high end multilayer switches, and the technology is definitely a "work in process". As networking technology evolves, multilayer switches are likely to replace routers in most large networks.
Functions
The basic function that any switch is supposed to perform is to receive information from any source connected to it and dispatch that information to the appropriate destination only. This thing differentiates switches from hubs. Hub gets the information and forwards that to every other device in the network. This is the reason why switches are called intelligent devices.
The network switch has become a crucial part of present local area networks (LANs). LANs with medium to large sizes are established using a number of inter-linked network switches. SOHO (Small Office/Home office) networks generally consist of a single switch, or sometimes a multi-purpose device like a residential gateway to utilize small office/home broadband services such as Digital subscriber line (DSL) and cable Internet. Nowadays, we have been using router-like components which interface to the particular physical broadband technology. We may see some people using telephone technology on internet using Voice over IP (VoIP).
As mentioned above, a switch is operated at the data link layer to develop a distinct collision domain for each port of the switch. Let us consider, there are four computers - A, B, C, and D connected to four ports of the switch, then any pair , say A and B, may transfer data in either directions, at the same time, the other pair, C and D, can exchange their information simultaneously, and these two communications will not interrupt each other. Using full duplex mode, pairs may get overlapped (A communicating with B, B with C, and so on). Whereas in hubs, all of them have to share the same bandwidth by running in half duplex mode, causing collisions, which will result in unnecessary packet re transmissions.

Network Switching

The benefits of switching vary from network to network. Adding a switch for the first time has different implications than increasing the number of switched ports already installed. Understanding traffic patterns is very important to network switching - the goal being to eliminate (or filter) as much traffic as possible. A switch installed in a location where it forwards almost all the traffic it receives will help much less than one that filters most Network response times (the user-visible part of network performance) suffers as the load on the network increases, and under heavy loads small increases in user traffic often results in significant decreases in performance. This is similar to automobile freeway dynamics, in that increasing loads results in increasing throughput up to a point, then further increases in demand results in rapid deterioration of true throughput. In Ethernet, collisions increase as the network is loaded, and this causes retransmissions and increases in load which cause even more collisions. The resulting network overload slows traffic considerably.
Using network utilities found on most server operating systems network managers can determine utilization and collision rates. Both peak and average statistics should be considered.
PURPOSE OF SWITCHES
Switches work the same way as hubs, but they can identify the intended destination of the information that they receive, so they send that information to only the computers that are supposed to receive it. Switches can send and receive information at the same time, so they can send information faster than hubs can. If your home network has four or more computers or you want to use your network for activities that require passing a lot of information between computers (such as playing network games or sharing music), you should probably use a switch instead of a hub. Switches cost a little more than hubs.
Rutter’s
         Routers have access to network layer addresses and contain software that enables them to determine which of several possible paths between those addresses the best for a particular transmission is.
          Router’s operate in the physical, data link, and network layers of the OSI model.
         Routers are another type of inter networking device.
         These devices pass data packets between networks based on network protocol or layer 3 information. Routers have the ability to make intelligent decisions as to the best path for delivery of data on the network.
Purpose of Rutter’s
Rutter’s enable computers to communicate and they can pass information between two networks—such as between your home network and the Internet. This capability to direct network traffic is what gives the router its name. Routers can be wired (using Ethernet cables) or wireless. If you just want to connect your computers, hubs and switches work well; however, if you want to give all of your computers access to the Internet using one modem, use a router or a modem with a built-in router. Routers also typically provide built-in security, such as a firewall. Routers are more expensive than hubs and switches.
Network with a wired router
An optical communications repeater receives light as input and outputs light. The output signal power source is external to the input power, but the output power may be driven by input power.
Radio repeaters are used in radio communication services such as Commercial or Amateur Radio. A radio repeater consists of a radio receiver connected to a transmitter. The radio signal is received, amplified and retransmitted, usually on a different frequency. Higher radio frequencies are limited to line-of-sight transmission, their range is blocked by mountains and the curvature of the Earth, and so repeaters are located on hills and mountains, to retransmit the signal beyond the obstruction. Radio repeaters are also used extensively in broadcasting, where they are known as broadcast relay stations. These extend the broadcast coverage area to remote communities, outside the range of the main broadcast station.
A dig repeater is a blend word meaning "digital repeater", particularly used in amateur radio. Store and forward dig repeaters generally receive a packet radio transmission

Function of a Router

The main function of a router is to enable the movement of data by a device from one network to another. A router is actually a specialized computer connected to one or more networks

MAIN FUNCTION OF ROUTER

Router has generally three main functions.
  • Packet Forwarding
  • Packet switching and
  • Packet filtering

PACKET FORWARDING:

Router maintains a routing table for all possible networks those can be reached.  In the routing table, a router maintains, subnet, Gateway, forwarding interface, timing etc of the destination network. If multiple paths exist to reach the destination network, only best path is maintained in the routing table .Once any packet is received, it checks the destination IP network in the routing table. If destination network is available in routing table, It forwards the packet otherwise it drops.

PACKET SWITCHING:

To move packets from one interface to another to get a packet to its destination.

PACKET FILTERING:

Packet filtering is such like firewall. By which you can define which network can be entered and which network can be dropped. In easy word, it filters the packet on the basis of IP address, subnet, and port no and protocols.
Repeaters
A network repeater is a computer hardware that is used to expand the boundaries of a wired or wireless local area network (LAN). These repeaters normally amplify data signals before sending them on to the uplinked segment, thereby countering signal decay that occurs over extended lengths of wire.
A repeater (or regenerator) is an electronic device that operates on only the physical layer of the OSI model. A repeater installed on a link receives the signal before it becomes too weak or corrupted, regenerates the original pattern, and puts the refreshed copy back on the link.
A repeater does not actually connect two LANS; it connects two segments of the same LAN. A repeater forwards every frame; it has no filtering capability

         

Function of a Repeater

A repeater is used to amplify signals carried by a network. The function of a repeater is to receive incoming signals or a packet of data, regenerate the signals to their original strength and retransmit them. When a repeater amplifies the electric signals in a network, they allow transmissions to travel a greater distance. For a repeater to work, both network segments must be identical
The function of a repeater is to amplify signals that are carried by a network. The repeater receives incoming signals, regenerates them to their original power and then retransmits them to cover longer distances.
A repeater is the simplest facility used for network interconnection, whose major function is to receive a network signal from one LAN terminal cable segment and to regenerate and retransmit the signal as it is in its original strength over a one or more other cable segment. Basically repeater regenerates the strength of the signal before transmitting it
Repeaters operate in the OSI model Physical layer and are transparent to all the protocols operating in the layers above the Physical layer.
A specific LAN implementation usually places a limit on the physical size of a single cable segment. The limit is based on the physical medium and transmission techniques used
Repeaters allow a network to be constructed to exceed the size limit of a single, physical, cable segment. The number of repeaters that can be used intandem is generally limited by a particular LAN implementation. Using a repeater between two or more LAN cables segment requires that the same physical layer protocol be used to send signal over all the cable segments
Example of how this work
Two LAN cable segment in an Ethernet LAN that both use baseband transmission could be connected with a repeater. Different types of physical transmission medium can be connected using a properly designed repeater as long as they handle similar type of signal, as explained below: Ethernet repeaters are available that allows all the various types of baseband Ethernet transmission medium, including 10baseT, Coaxial cable, 10base2 and twisted pair cable segment to be interconnected in the same LAN

Purpose of Repeaters
Repeaters are used to increase the range of a transmitted signal by re-transmission. For a conducted signal, an amplifier is used. Optical systems don't amplify but all these devices give the appearance of doing so.
Some of the energy traveling as direct current through a conductor is converted to heat energy. This causes a drop in potential energy (a voltage) across the ends of the conductor proportional to the current times the inverse of the conductor's conductance. Energy passing as alternating current is also lost as it travels but, since it changes direction, there is an additional loss proportional to the capacitive reactance times the current. Since alternating voltage and its current are out of phase, total losses equal the vector sum (rather than linear sum) of the two losses. Similarly, light, which consists of photons rather than electrons, suffer attenuation due to scattering and absorption. And then retransmit it on the same frequency. When providing a point-to-point telecom link using radio beyond line of sight, one uses repeaters in a microwave radio relay. A reflector, often on a mountaintop, that relays such signals around an obstacle, is called a passive repeater.
.

 FREQUENCY MODULATION


A) OBJECTIVES

§  To understand message signal, carrier signal and FM modulated waveform.
§  To use MATLAB to:
- Create FM signal by modulating a sinusoidal and non-sinusoidal message onto a carrier.
- Examine frequency spectrum of frequency modulated signal.
- Evaluate frequency spectrum of the modulated signal when the modulation index is varied.
- Demodulate the FM signal and recover the original message waveform.
§  To illustrate FM blocks using SIMULINK.


B) THEORY OF FREQUENCY MODULATION

FREQUENCY MODULATION (FM)

An alternative system to Amplitude Modulation is Frequency Modulation. In this modulation scheme the carrier frequency increases as the voltage in the information signal increases and decreases in frequency as it reduces. The larger the amplitude of the information signal, the further the frequency of the carrier signal is shifted from its starting point. The frequency of the information signal determines how many times a second this change in frequency occurs. This modulation process does not affect the amplitude of the carrier.

(1)
 
The amplitude of the modulated carrier is held constant and either the phase or the time derivative of the phase of the carrier is varied linearly with the message signal m(t). Thus the general angle modulated signal is given by:
x(t) = Ac cos (2p fct + q (t) )

The quantity 2p fc + q (t) = yi(t) is called the instantaneous phase of x(t), while the quantity    q (t)  is called the phase deviation of x(t). The instantaneous angular frequency of x(t), defined as the rate of change of the instantaneous phase and having units of radians per second, is given by:

(2)
 

The instantaneous frequency fi (t), having units of Hertz (Hz), of x(t) is accordingly given by:

(3)
 
The quantity  is called the angular frequency deviation. The two basic types of angle modulation are Phase Modulation (PM) and Frequency Modulation (FM).

 





















VARIATION OFq (t) PRODUCES PHASE MODULATION

Phase modulation implies that q (t) is proportional to the modulating signal. Thus q (t)=kpm(t), where kp is the deviation constant in radians per unit of m(t). Therefore, the time domain expression for PM is given by:

(4)
 
x(t) = Ac cos (2p fct + kpm(t))

VARIATION OF   PRODUCES FREQUENCY MODULATION
Frequency modulation implies that  is proportional to the modulating signal. This yield:
(5)
 


Thus, in FM the instantaneous frequency varies linearly with the message signal and is given by:
(6)
 
 


                                                            fi = fc  + kf m(t).

The term kf , expressed in Hertz per unit of m(t), represents the frequency sensitivity of the FM signal.

The phase angle q (t) of FM signal is given by:

(7)
 

Therefore, the time domain expression for FM is given by:

(8)
 


FREQUENCY DEVIATION, MODULATION INDEX AND SPECTRUM OF FM 

Consider a sinusoidal modulating information signal given by:
(9)
 
 


m(t) = Am cos(2p fm t )

The instantaneous frequency of the resulting FM signal equals:

(10)
 
fi(t)  = fc  + kf m(t) = fc  + kf Am cos(2p fm t )

(11)
 
The maximum change in instantaneous frequency fi from the carrier frequency fc, is known as frequency deviation Df, where it is given by:
D f = kf Am

Frequency deviation is a useful parameter for determining the bandwidth of FM signals. For example, an information signal of peak-to-peak voltage of 6 volts and a frequency of 10kHz with a frequency deviation of 15 kHz/V would cause a FM carrier to change by a total of 90 kHz (45 kHz above and below the original carrier frequency). The carrier frequency would be swept over this range 10,000 times a second.

Next, the FM modulated signal is given by:
(12)
 
 


where  is the modulation index of the modulated signal. In general, for a non-sinusoidal m(t) signal, the modulation index is defined as:

(13)
 

where, W is the bandwidth of the message signal, m(t).

In case of a sinusoidal message signal, the modulated signal can be represented by:

(14)
 

where Jn(b) is known as Bessel functions in the order n and argument b. Some of the selected values of Jn(b) is listed in Table 1. In the frequency domain, we have:

(15)
 

From the equations (14) and (15) and Table 1, we observe that :
1.      The spectrum consists of a carrier-frequency component and an infinite number of sideband components at frequencies fc ± nfm (n = 1,2,3,4,5…..).
2.      The relative amplitudes of the spectral lines depend on the value of Jn(b), and the value of Jn(b) becomes very small for large values of n.
3.      The number of significant spectral lines (that is, having appreciable relative amplitude) is a function of the modulation index b. With b << 1, only J0 and J1 are significant, so the spectrum will consists of carrier and two sideband lines. But if b >> 1, there will be many sideband lines. The amplitude spectrums of FM signals for several values of b are shown in Figure 2.

n\b
0.1
0.2
0.5
1
2
5
0
0.997
0.990
0.938
0.765
0.224
-0.178
1
0.050
0.100
0.242
0.440
0.577
-0.328
2
0.001
0.005
0.031
0.115
0.353
0.047
3


0.003
0.020
0.129
0.365
4



0.002
0.034
0.391
5




0.007
0.261
6




0.001
0.131
7





0.053
8





0.018
9





0.006
10





0.001
Table 1: Selected value of Jn(b).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 2: Amplitude spectrum of sinusoidal modulated FM signals (fm fixed).

 

 

C) MATLAB AND SIMULINK


MATLAB is an interactive matrix based system for scientific and engineering numeric computation and visualization. Its strength lies in the fact that complex numerical problem can be solved easily and in a fraction of the time required with a programming language such as Fortran or C. It is also powerful in the sense that by using its relatively simple programming capabilities, MATLAB can be easily extended to create new commands and functions.

SIMULINK is a software package in MATLAB used for modeling, simulating and analyzing dynamical systems. It supports linear and nonlinear systems, modeled in continuous time, sampled time or a hybrid of the two. Systems can also be multirate that has different parts that are sampled or updated at different rates. For modeling, SIMULINK provides a graphical user interface (GUI) for building models as block diagrams, using click-and-drag mouse operations. With this interface, you can draw the models just as you would with pencil and paper (or as most textbooks depict them). It also includes a comprehensive block library of sinks, sources, linear and nonlinear components and connectors.

Models are hierarchical, so you can build models using both top-down and bottom-up approaches. You can view the system at a high level, then double-click on blocks to go down through the levels to see increasing levels of model detail. This approach provides insight into how a model is organized and how its parts interact. After you define a model, you can simulate it, using a choice of integration methods, either from the SIMULINK menus or by entering commands in MATLAB's command window. The menus are particularly convenient for interactive work, while the command-line approach is very useful for running a batch of simulations. Using scopes and other display blocks, you can see the simulation results while the simulation is running. In addition, you can change parameters and immediately see what happens, for "what if" exploration. The simulation results can be put in the MATLAB workspace for post-processing and visualization. Model analysis tools include linearization and trimming tools, which can be accessed from the MATLAB command line, plus the many tools in MATLAB and its application toolboxes.


D) EXPERIMENT PROCEDURES – MATLAB

1.      Open and start the MATLAB program by double-clicking the MATLAB icon.

2.      Type the command in the MATLAB COMMAND WINDOW or create a script file in the MATLAB EDITOR.

3.      Given a 100Hz continuous time sinusoidal message signal, m1(t) = 0.8 sin (200pt) is frequency modulated by a carrier of  s1(t) = 0.8 cos (2000pt). Using sufficient points and sampling interval of 0.0001 seconds, plot the message and carrier signals for duration of 0.05 seconds. (Use the commands subplot and plot in MATLAB and select an appropriate time interval for each plot).

4.      Write the time domain expression for the modulated signal by using the following equation:
Find the result of  by integrating the message signal, m1(t). Assuming that the frequency sensitivity, kf = 625 Hz/V, what is the modulation index for this signal? Plot the modulated signal for the duration of 0.05 seconds.

You can also find the result of  numerically in MATLAB by using cumsum(x)/Fs, function where x and Fs are the message signal and sampling rate used, respectively. Plot the modulated signal using the cumsum function for the duration of 0.05 seconds. Compare the plots. Are they the same?

5.      You can make use of the modulate function in MATLAB to generate your FM signals. Study this function by typing help modulate in the MATLAB command prompt. Repeat your plot for the modulated signal using this function. (Note that the kf for the modulate function must be set to kf = 2p(kf )/Fs, as a normalized value with respect to the sampling rate).



6.      The normalized magnitude spectra (or frequency spectrum) of a signal can be plotted using the built-in fft and fftshift functions in MATLAB. Use the following MATLAB function ft.m in order to plot the magnitude spectra or spectrum for message signal, m1(t).


% Fourier Transform function, m-input signal, ts-sampling interval
% Save this function as ft.m in MATLAB work directory
function [M,m]=ft(m,ts)            % return the value M and m
df=0.5;                            % frequency resolution
fs=1/ts;                                % sampling frequency
n1=fs/df;                          % refining resolution
n2=length(m);                      % number of point of the signal
n=2^(max(nextpow2(n1),nextpow2(n2)));
M=fft(m,n);                        % fourier transform of the signal
m=[m,zeros(1,n-n2)];
df=fs/n
M=M/fs;                            % scaling
f=[0:df:df*(length(m)-1)]-fs/2;    % frequency vector
plot(f,abs(fftshift(M)))                % plot & shift the DC component


Subsequently, use the above function to plot the magnitude spectra (spectrum) for the carrier, s1(t) and frequency-modulated signal, x1(t). You may use the command axis to refine the scales in your plot.

7.      Frequency modulation can be categorized into either narrowband or wideband. When the modulation index, b is very small, it is usually called narrowband FM (NBFM). Generate the spectrum of the above frequency-modulated signal, x1(t) when the modulation index, b = 0.005, 0.1, 1, 10 and 50. Observe the change of the spectrum shape for various modulation indices. What can you conclude when the modulation index is very large?

8.      MATLAB has a built-in function called demod utilizing the linear frequency-to-voltage transfer characteristic (frequency discriminator) that could be used to demodulate a FM signal. All parameters used in the demod function are as sets in the previous modulate function. Generate the time domain plot for demodulated FM signal when b = 5 by using this function. Did you recover the original message signal?

9.      Now, consider a non-sinusoidal message signal of, m2(t) as shown below:
with a bandwidth of 20Hz is modulated by a carrier, s2(t) = cos (400pt). Assuming that the frequency sensitivity, kf = 50, what is the modulation index for this FM signal?

Plot the time domain and spectrum for the above message m2(t), carrier s2(t) and modulated signal x2(t). Use the functions cumsum and modulate for the modulated signal for comparison purposes. You may look at the command subplot for instruction on plotting several figures in one display window. Limit your time domain plot to a sampling interval of 0.0005 seconds for duration of 0.15 seconds. Demodulate the FM signal and compare to the original message signal.



E) EXPERIMENT PROCEDURES – SIMULINK
1.      Type simulink at the MATLAB COMMAND prompt.
* The Simulink Library Browser window is opened.
2.      Create a new model window by clicking the Create a new model button on the Library Browser toolbar or click File >> New >> Model.
* A new empty workspace window is opened.
3.       Double-click to expand the Simulink folder at the Library Browser window.
4.      Double-click to expand the Sources sub-folder in the Simulink folder.
5.      Drag and drop Signal Generator module into the new empty workspace window.
6.      Go to Communications Blockset -> Modulation -> Analog Passband Modulation sub-folder.
7.      Drag and drop FM Passband and FDM Passband modules into the workspace window.
8.      Go to DSP Blockset -> Filtering -> Filter Designs sub-folder. Drag and drop Analog Filter Design module into the workspace window.
9.      Go to Simulink -> Sinks sub-folder. Drag and drop THREE Scope modules into workspace window.
10.  Go to Simulink Extras -> Additional Sinks sub-folder. Drag and drop FOUR Power Spectral Density modules into workspace window.







11.  Connect all the inserted modules as shown below.
12.  Set the parameters of the different blocks in your workspace as follows:
Block Model
Parameters to be set
Signal Generator
Waveform type: Sine
Amplitude: 0.8
Frequency: 100 Hz
FM Passband Modulator & Demodulator
Carrier Frequency: 1 kHz
Initial phase: 0 radian
Modulation constant: 625 Hz/V
Sample time: 10 ms
Analog Filter Design
Filter type: Butterworth Low Pass Filter
Filter Order: 5
Passband Edge: 600 rad/s
Power Spectral Density
Length of buffer: 4096
Number of points for fft: 4096
Plot after how many points: 4096
Sample time: 10 ms


13.  Set the simulation parameters (Simulation >> Parameters) as follows:
14.  Run (Simulation >> Start) the simulation and observe the output waveforms in both time and frequency domains of the message, carrier, modulated and demodulated signals. Compare these graphs with that obtained in Section D) EXPERIMENT PROCEDURES – MATLAB.
15.  Change the message to a square wave and run the simulation again. What is the optimum cut-off frequency for the low pass filter at the demodulator?

F) REFERENCES

[1] B. P. Lathi, “Modern Digital and Analog Communication Systems”