DSP Processor Implementation of A Modem For Narrow Bandwidth Channel
DSP Processor Implementation of A Modem For Narrow Bandwidth Channel
DSP Processor Implementation of A Modem For Narrow Bandwidth Channel
CHAPTER-1 AN OVERVIEW
INTRODUCTION
A typical communication system will input data, perform some form of processing and frequency translation, transmit the data, and perform the converse operations at the receiver. The transmission of data is done using Public Switched Telephone Network (PSTN). Traditionally, the PSTN has been viewed as an analog network. In reality, however, the PSTN as we presently know it has become an almost entirely digital network. In most of cases, the only part of the PSTN that has remained analog (and will likely remain so far many years to come) is the local loop, which represents relatively short connection from a home to central office. The modem contraction of the term modulator-demodulator is a conversion device that facilities the transmission and reception of data over a public switched telephone network (PSTN). The data of interest may be digital signals generated by computers and service providers. In such application, the modulator portion of the modem converts the incoming digital signal into a standard form suitable for transmission over a telephone channel in the PSTN. The demodulator portion of the modem receives the channel output and reconverts it into original digital signal format.
What exactly is a modem? A modem is simply a device that takes a stream of data and turns it into sound. It operates, in its simplest form like a speaker and a microphone. If a bit of data from your computer is on, or high, then the tone the modem produces is of one pitch. If the data bit is low or off, then the modem produces another sound. The modem on the other end of the phone line simply listens to the line and re-converts the tones back to the 1s and 0s that make up the letters that make up words. At first the fastest modem you could buy was 300 baud. The 300 baud transmission protocol is called V.21 or Bell 103. That means it could send and receive 300 bits a second. Since a letter is made up of 8 bits this means we could send about 37 letters a second. Actually since there is a little overhead in the form of start and stop bits, the bits that tell the computer that this is the beginning and end of a character, we end up with 30 characters a second. Thats characters, not words. If you think about it most people can read much faster than that. Most of us have seen this kind of modem on TV and in movies. They were the kind you actually put the handset from a phone on a cradle that had cups for the earpiece and mouthpiece. These modems were call acoustically coupled. Just plain sound with a microphone and speaker built into the cradle. It took a long time for computer engineers to make affordable modems that could go faster than 300 baud. Eventually they did however and the 1200 baud modem was born. The 1200 baud protocol is called V.22 or Bell 212. When the math is done that comes out to about 120 characters a second or twenty four five letter words. At nearly the same time simple compression was beginning to be used. Compression is the ability to smash data down to a smaller number of bits and bytes. The first data compression was very simple. It squeezes out the blank spaces and unused bits and puts them back in on the other end. This scheme works ok on text but is not very good for binary programs or pictures. This kind of compression was also done on the computer before it was sent to the modem. As a result the overall time it took to send data from one computer to another did not decrease too much since the computers of the day had to work fairly hard to compress the data.
It did not take long for the 2400 baud modems to hit the market. The 2400 baud protocol is called V.22 BIS. This doubled our transfer rate and later models of these modems came with new data compression and error correction scheme, called V.42 or the Auto Reliable Protocol. The speed increase was great. Now we could actually receive at about the speed you could comfortably read. V.42 was a great boon too. Now, for the first time, we had almost error free data transmissions that were compressed fairly well at 4 to 1 and greatly reduced the overall time needed to transmit data and thus lowering long distance charges. At the same time all this speed was increasing the computer users were treated to another big development. Most 2400 baud modems also had fax send and receive capabilities. At first only at 4800 baud, in a very short time the electronics in the modems could run 9600 baud and take advantage of the newer faster fax machines. Youre probably wondering why they didnt just make modems transfer data at 9600 baud too. Fax machines use a different kind of tone recognition than modems do. Faxes use more than just two tones so the speed could be increased by the multiple of the number of tones. Also if you drop a bit on a fax you end up with a white spot on the page about the size of a pin head or 1/100th of an inch. If you drop a bit in a data stream you end up with a whole new letter or character. The next advance in modems was the short lived 4800 baud variety. There were not very many of these sold since the 9600 baud modems came bounding onto the market. Both 4800 and 9600 baud protocols are called V.32.
from an analogue information source, the signal must be band limited to a bandwidth B before sampling takes place. According to the nyquist rate the sampling frequency should be equal to or higher than twice the band limited signal(fs>_2B). the energy of the voice signal is concentrated at frequencies below 4khz, hence the speech signals are typically lowpass filtered in order to accurately reconstruct the actually signal. In practice most of the voice communication system uses the sampling rate of 8kHz.
Symmetric modem configuration:The simplest approach for design of modems is to treat the entire PSTN as a linear network. In such a setting, analog to digital and digital to analog conversions are needed whenever the modems send the signals to and receive the signals from PSTN.
Figure:1.1 Modem configuration: the upstream and down stream data rates is equal. The modem configuration exhibits symmetry in that both modems are identical and the data rate downstream is exactly same as the data rate upstream.
Asymmetric modem configuration:For a more efficient use of PSTN, we should treat it as what it really is an almost entirely digital network that is nonlinear. In particular, the ISP is digitally implemented;
ECE Department, Gitam University
the digital to analog conversion at the ISP modem is eliminated. This means that the communication between the ISP and PSTN can be entirely digital. The users modem has to remain analog because local loop is analog. This in turn requires the analog to digital and digital to analog conversions each time the user modem sends the signals to and receives the signals from the PSTN.
Figure:1.2 modem configuration of upstream and downstream for asymmetric network. In general the popular V.32 modem standards that has the following characteristics: Carrier frequency: 1,800 Hz Modulation rate= 2,400 baud Data rate= 9,600 b/s. In the modems we can use different modulations technique for the coding and decoding of the information and get the data transfer from transmitter to receiver sections. We are going to implement the BSPK, QPSK, QAM modulation techniques in the mat lab for data transmission and reception.
CHAPTER-2 INTRODUCTION
INTRODUCTION
2.1 BACKGROUND
This project deals with voice transmission over a channel. For this purpose, some modulation schemes and voice coders are to be implemented. Voice coding and transmission is an important and pervasive task in any telecommunication system. A simple transmission/reception scheme intended for voice transmission is proposed in the figure below consisting of: one microphone; a DSP board for voice acquisition, sampling, coding and modulation; a channel emulator; a second DSP board for voice processing or signal decoding, demodulation and voice reconstruction; a loudspeaker; and finally two PCs that control each DSP. Voice coding and transmission is an important and pervasive task in any telecommunication system. Actually, voice transmission has been spread out from the classical telephone oriented network (POTS) to the packet oriented networks like the Internet (VoIP).
This voice transmission scheme represents the basis of this project. The transmitter and the receiver have to be synchronized. At the transmitter the input voice is parameterized (codified) and modulated; while at the receiver is synthesized (decodified) and demodulated. The output data of the transmitter is sent though the base-band channel of the emulator, which emulates a realistic wireless channel with fading and noise. The voice processing is done in real-time, and the recovered voice is displayed on the loudspeaker.
2.2 SPECIFICATIONS
The implementation of the voice transmission system in real time is done using two standard PCs with one DSP board each. All processing is performed in the DSP except presentation of results and loading of files, which are done on the PC. In addition to the implementation on the DSPs, a Matlab simulation will be done. In this project the Matlab prototype is able to transfer a segment of pre-recorded voice or digital sequence, which is encoded and modulated, and sent over the wireless channel. At the receiver, the data is captured and processed off-line. The offline processing consists of synchronization, demodulation and re-generation of the output.
2.3 RESOURCES
2.3.1 Hardware Two DSK boards Two standard PCs Microphone Loud speaker Oscilloscope Function Generator
2.3.2 Software
Mat lab software Code Composer studio
10
11
Each section of the block diagram explanation is done below: Transmitter Receiver
12
3.2 TRANSMITTER
The input of the transmitter is the recorded speech by the microphone. An A/D converter samples the voice to obtain digital data from this input signal. The data is then down-sampled and encoded. The encoder performs speech coding aiming to reduce the bit rate of the data sequence. The data bits are multiplexed dividing them into frames and adding guard, training and estimation bits to form the packet. A modulator is in charge of convert the digital packet into waveforms that are compatible with the nature of the channel. Pulse-shaping and up-sampling is applied to this modulated sequence. Finally, up-conversion is used to transmit through the physical channel.
3.2.2 DECIMATION
ECE Department, Gitam University
13
After A/D conversion, the digital signal is filtered using low pass filter in order to prevent the aliasing effect in decimator. Thus Down sampling is applied in order to omit the high frequency components and consider the necessary information.
3.2.3 ENCODER
By preprocessing the input signal, now the signal will be encoded in order to reduce the bit-rate required for the transmission. The transmission of bits is done by adding the extra bits like guard bits, parity bits etcin order to avoid the bits loss of transmission.
3.2.4 MULTIPLEXER
The output of encoder is a stream of data bits which are obtained. These data bits have the extra bits that added in order to avoid the loss of transmission and its length may of 36 bits per frame.
14
3.2.5 MODULATION
The multiplexed binary data is digitally modulated to transform it into waveforms that are compatible with the nature of the communication channel. There are different modulators with different constellation points that are used in the modulation.
3.2.6 PULSE SHAPING OR UPSAMPLING:After modulation, the symbols cannot be transmitted right away. They need to be up-sampled and shaped. The pulse shaping is, in fact, an amplitude modulation.
3.2.7 UP CONVERSION:Sub-sequent to pulse-shaping is carrier modulation. The output of the modulator is a base-band signal that has to be up-converted to the desired carrier frequency in order to better suit the characteristics of the channel.
3.3 CHANNEL
In the channel the message signal g(t) and the carrier signal w(t) is added and passed through the channel. r (t) signal is obtained is the transmitted signal which is passed towards the receiver section.
15
3.4 RECEIVER
\
Figure 3.5
The input of the receiver is the received signal from the channel. This signal is first down-converted and low-pass filtered. Then matched filtering is applied taking into account the pulse-shape used at the transmitter. The received signal has to be synchronized and this is done based on the cross-correlation between this signal and known training sequence at the receiver. After knowing the correct position when the sequence starts, the signal is down-sampled. Finally, the data is demodulated, decoded, up-sampled to the original frequency, and D/A converted to display the reconstructed speech using a loudspeaker.
16
local oscillator signal, followed by a lowpass filter to remove terms of frequency 2fc and fulfill the sampling theorem when sampling and converting into a discretetime signal.
3.4.3 DEMODULATION
The purpose of the demodulator is to map the symbols back to sequences of bits, which can be then processed by the voice decoder. Three different modulation schemes have to been implemented.
3.4.4 UP SAMPLING
Reconstructed speech signal was a downsampled version of the original signal. Therefore, it is upsampled by a factor of 8, so that an estimate of the original digital signal is obtained. After up-sampling, the signal is filtered using a low-pass filter (interpolation filter) in order to avoid aliasing.
17
For the transmission and reception of the signals in mat lab that are implemented using different modulation techniques of BPSK, QPSK, QAM which are explained in next chapters.
18
BPSK TECHNIQUE
In the project we are using modulation techniques of BPSK, QPSK, and QAM. In this we are going to explain the theory part of BPSK, QPSK and mat lab output theoretically which have to be obtained.
Digital modulation technique is classified into two types coherent and Non coherent techniques depending on the phase recovery circuit or not. The phase recovery ensures that the oscillator supplying the local generated carrier wave in the receiver is synchronized (in both frequency and phase) to the oscillator supplying carrier wave used to originally modulate the incoming data stream in the transmitter.
19
Figure 4.1 For the digital information transferring and receiving internal block diagram is shown below In the digital information where the speech in digital encoded form with a bit rate of 16 kbit/s, and after Forward Error correction(FEC) coding the data rate becomes 32 kbits/s. we can keep the channel about 1 Ghz, range which is better to transmit the 32 kb/s. if the phase of the carrier is switched between 32kbits/s, being at 0 deg and 180 deg for bits having logic 0 and 1 then there are 31,250 radio frequency oscillations per bit transmitted. The output waveform shown below for the logic 0 and 1 is shown below for the 0 deg and 180 deg.
Figure 4.2 BPSK output waveform For logical 0 the phasor diagram is shown along the positive axis and logical 1 the phasor diagram is shown along the negative axis. For the sequence of the bits the modulator output of the BPSK is shown below, which is the combination of the above diagram:
20
Figure 4.3 BPSK waveform II BPSK modulation technique the constellation diagram shown below which are transmitting binary data there are only two points. As these two points are at equal distance from origin we would expect them to represent equal magnitude carriers.
Figure 4.4 BPSK Constellation Diagram In Binary Phase shift keying (BPSK), determining the phase of transmitted signal and decoding the transmitted information. This problem is also known as the carrier recovery attempt is made to recover the phase of the carrier. When a phase point at, say, 180 deg is selected to reflect the information being transmitted, the phase of the transmitted carrier is set to 180 deg. However the phase of the carrier is often changed by the transmission channel with result that the receiver measure a different phase. In order to overcome this problem there are two ways: Coherent detection Non coherent detection.
21
In coherent detection we have to measure the phase change imposed by the channel and then the receiver determine the transmitted phase. This is known as the coherent detection. In Non coherent detection we have transmit the phase difference rather than actual phase. The receiver merely compares the actual phase with current phase and the phase changed is removed. This is known as Non coherent detection.
a pair of sinusoidal waves that differ only in a relative phase shift of 180 degrees. From pair of equations it is clear that, in the case of binary PSK, there is only one basis equation of unit energy namely, c(t) = root(2/Tb) cos(2*pi*f*t) we express the transmitted signals as a(t) = root(Eb)*c(t) ; b(t) = -root(Eb)*c(t) ; 0<t<Tb 0<t<Tb (4.4) (4.5) (4.3)
22
Figure 4.5 QPSK Waveform In this way you will get the transmitted waveforms with message points of Eb theoretically. In BPSK the signal bandwidth for the communications channel needed depends on the symbol rate, not on the bit rate. In this symbol rate is equal to bit rate because only two bits are transmitted. The actual formula for the symbol rate is given as: Symbol rate = bit rate/ The number of bits transmitted with each symbol (4.6)
For the BPSK modulation technique that is to be implemented in the project where we are giving the random bit stream with SNR = 0.5 or 5 and obtain the output in the MATLAB. In the below we had shown the output of the BPSK that is to be obtained in MATLAB:
23
Figure 4.6 MATLAB plots for random bit stream shown the transmitted and received waveforms with SNR = 0.5
Figure 4.7 MATLAB plots for random bit stream shown the transmitted and received waveforms with SNR = 5
24
Figure 4.8 MATLAB plots displaying decision regions and detection for (a) SNR =0.5
Figure 4.9 MATLAB plots displaying decision regions and detection for (b) SNR = 5.0. In the received signal fall out of the decision region resulting in errors. The received signal is noisier and resulting in false detection. These are the mat lab plots that are to be obtained in BPSK.
25
Where i=1, 2, 3, 4; E is the transmitted signal energy per symbol and T is the duration symbol. The carrier frequency fc equals to nc/T some fixed integer nc. Each possible value of phase corresponds to a unique dibit. For example if we have chosen the set of phase values to represent the Gray-encoded dibits: 10, 00, 01 and 11, where only a single bit is changed from one dibit to the next.
26
There are two orthogonal functions explained as A (t) and B (t) defined as a quadrature carriers:
A (t) = root(2/T) cos (2*pi*fc*t) B (t) = root(2/T) sin (2*pi*fc*t) Gray encoded input dibit
10 00 01 11
(4.9) (4.10)
There are four message points and signal vector are explained in the below diagram:-
27
Figure 4.10 Signal space QPSK diagram According to Quadrature Phase shift keying (QPSK) signal has a two dimensional signal constellation i.e.., N=2 and four message points i.e.., M=4 whose phase angle increases in a counter clockwise directions. We can explain QPSK with an example by taking a sequence and plotting the waveforms for the generation of the signal. The input bit sequence 01101000 is shown in the figure below. The sequence is divided into two other sequences, consisting of odd and even numbered bits of input sequence. The waveforms representing the two components of the QPSK signal, namely, S(t)* A(t) and S(t) * B(t). These two waveforms can be individually shown and adding both we get the QPSK waveform.
28
Figure 4.11(a) Input binary sequence; (b) odd numbered bits of input sequence (c) Even numbered bits of input sequence (d) QPSK waveform.
Error probability of QPSK:In the coherent QPSK system, the received signal x (t) is defined by, X (t) = S (t) + W (t) (4.11)
Where W (t) is the white Gaussian Noise process of zero mean and power spectral density No/2. For the incoming bit sequence the bit error rate formula is given as:BER = erfc (root [Eb /No]) Generation and detection of QPSK signals:Consider the generation of the QPSK signals. We had shown the block diagram of the QPSK transmitter. The incoming binary data sequence is first transformed into polar form by Noreturn to zero level encoder. Thus the symbol 1 and 0 are represented by +root (Eb) and root (Eb). This binary wave is next divide by means of a demultiplexer into two separate binary waves consisting of odd and even numbered sequences of input bits. These two binary waves are denoted by a1 (t) and a2 (t) depending on the particular
ECE Department, Gitam University
(4.12)
29
dibit that is transmitted. These two binary waves are modulated a pair of quadrature carriers.
Figure 4.12 The above block diagrams show the Quadrature Phase shift keying (QPSK) transmitter and receiver sections.
Phase Shift Keying (PSK) is a method of transmitting and receiving signals in which the phase of the transmitted signal is varied to convey the information. A common type of PSK is Quadrature Phase Shift Keying (QPSK). It is used extensively in applications including CDMA (Code Division Multiple Access) cellular service, wireless local loop, Iridium (a voice/data satellite system) and DVB-S (Digital Video Broadcasting-Satellite).
30
In QPSK, the data bits to be modulated are grouped into symbols, each containing two bits, and each symbol can take on one of four possible values: 00, 01, 10 and 11. The signal shifts in intervals of /2 radians from /4 to 3/4, 5/4 or 7/4 radians, such that the signal constellation matches the configuration shown in Figure 2.6 [5]. The symbol rate for QPSK is half the bit rate, therefore exhibits the same performance but twice the bandwidth efficiency compared to BPSK.
31
32
QAM THEORY
Now in the project we are going to implement another modulation technique QAM in mat lab where to check the information transmitted or received perfectly or not.
33
In general, grouping n bits into one signalling symbol yields constellation points, which are often referred to as phasors, or complex vectors. The phasors are associated with these points may have different amplitude and phase values and these type of modulation referred to as multi-level modulation, where the number levels is equal to the number of constellation points. After the transmission through the channel the receiver must identify the phasor transmitted, and in doing so can determine the constellation points and hence the bits associated with these points. In this way data is recovered. There are many problems with attempting to recover data transmitted over fixed channels such as telephone lines and radio channels and many of these problems are rectified. In the ends of 1950s there was a considerable amount of interest digital phase modulation transmission schemes as an alternative to digital amplitude modulation. Digital phase modulation schemes are those whereby the amplitude of the transmitted carrier is held constant but the phase changed in the response to the modulating signal. All the fundamental problems in PSK is that transmitting the phase of the transmitted signal and hence decoding the transmitted signal. When a phase point, say 90 degrees is selected to reflect the information being transmitted, the phase of transmitted signal is set to 90 degrees. However, the phase of the carrier is often changed by the transmission channel with the result that the receiver measure a different phase. This means that unless the receiver knew that the phase change imposed by the channel was it would be unable to determine the encoded information. This problem is overcome by two ways. Coherent Detection and Non Coherent detection.
5.2 QAM TYPES OF CONSTELLATIONS:In the QAM w have different type of constellations. Those are: Type-I constellation Type-II constellation Type-III constellation
34
Using these different constellations the performance of the circular type constellation could be improved by having more points on the ring formation. The rationale for this was that errors were caused when noise introduced into the signal moved the receiver phasor from the transmitted constellation point to different one. In Type-I conceded that a system with unequal number of points on each amplitude ring would be more complicated to implement, particularly in the case of non coherent detection. There is improvement in Type-II from Type-I where 3db in mathematical approach. In the Type-III has better performance than Type-II where new constellation the square QAM system has been obtained. They described this system as essentially amplitude modulation and demodulation of two carriers that have same frequency but are in quadrature with each other- the first time that combined amplitude and phase modulation had been thought of as amplitude modulation on quadrature carriers. But in problem in Type-III is that it can used in Coherent Detection and not possible in Non coherent detection. Theoretical analysis is performed on Gaussian noise channels and came to conclusion that the Type-III has small improvement in performance than Type-I and Type-II.
35
(5.1)
where the carrier cos (Wct) is said to be amplitude modulated if its amplitude a(t) is adjusted in accordance with the modulating signal, and is said to be phase modulated if (t) is varied in accordance with the modulating signal. In QAM the amplitude of the baseband modulating signal is determined by a(t) and the phase by (t). The in-phase component I is given by:I = a(t) cos (t) And the quadrature component Q by Q = a(t) sin (t) (5.3) (5.2)
The signal is corrupted by the channel. Here we will only consider Additive White Gaussian Noise (AWGN). The received signal is then given by r(t) = a(t) cos[2fct+(t)]+ n(t) (5.4)
36
Where n (t) represents the AWGN, which has both in-phase and quadrature component. It is received signal which we will attempt to demodulate. In the QAM technique for high transmission has implied relatively simple equalisers if they are implemented with the existing circuitry. In general two equalisers frequently used are the linear and the decision feedback equalizer. In the next following sections, we consider the aspects of specific equalizers to QAM, and consider some of the actual implementations. We consider different equalizers of algorithms like Trained LMS, Decision Directed Equalizer.
It is customary to call the real part, A n, the in phase or I component and the imaginary
37
38
39
40
Features
The DSK comes with a full compliment of on-board devices that suit a wide variety of application environments. Key features include: A Texas Instruments TMS320C6713 DSP operating at 225 MHz. An AIC23 stereo codec 16 Mbytes of synchronous DRAM 512 Kbytes of non-volatile Flash memory (256 Kbytes usable in default configuration) 4 user accessible LEDs and DIP switches Software board configuration through registers implemented in CPLD Configurable boot options Standard expansion connectors for daughter card use JTAG emulation through on-board JTAG emulator with USB host interface or external emulator Single voltage power supply (+5V)
41
The DSK includes 4 LEDs and a 4 position DIP switch as a simple way to provide the user with interactive feedback. Both are accessed by reading and writing to the CPLD registers.An included 5V external power supply is used to power the board. On-board switching voltage regulators provide the +1.26V DSP core voltage and +3.3V I/O supplies. The board is held in reset until these supplies are within operating specifications. Code Composer communicates with the DSK through an embedded JTAG emulator with a USB host interface. The DSK can also be used with an external emulator through the external JTAG connector.
6.4 ARCHITECTURE
The simplified architecture of TMS320C6713 is shown in the Figure below. The processor consists of three main parts: CPU, peripherals and memory.
42
43
packets can vary in size. The variable-length execute packets are a key memory-saving feature, distinguishing the C67x CPU from other VLIW architectures. The CPU also contains two data paths (Containing registers A and B respectively) in which the processing takes place. Each data path has four functional units (.L, .M, .S and .D).
44
The TMS320C67x devices contain peripherals for communication with off-chip memory, co-processors, host processors and serial devices. The following subsections discuss the peripherals of C6713 processor.
45
The external memory interface (EMIF) supports an interface to several external devices, allowing additional data and program memory space beyond that which is included on-chip. The types of memories supported include: Synchronous burst SRAM (SBSRAM) Synchronous DRAM (SDRAM) Asynchronous devices, including asynchronous SRAM, ROM, and FIFOs. The EMIF provides highly programmable timings to these interfaces. External shared-memory devices
46
Data communication between MCBSP and the devices interfaced takes place via two different pins for transmission and reception data transmit (DX) and data receive (RX) respectively. Control information in the form of clocking and frame synchronization is communicated via CLKX, CLKR, FSX, and FSR. 32-bit wide control registers are used to communicate MCBSP with peripheral devices through internal peripheral bus. CPU or DMA write the DATA to be transmitted to the Data transmit register (DXR) which is shifted out to DX via the transmit shift register (XSR). Similarly, receive data on the DR pin is shifted into the receive shift register (RSR) and copied into the receive buffer register (RBR). RBR is then copied to DRR, which can be read by the CPU or the DMA controller. This allows internal data movement and external data communications simultaneously.
6.5.5 TIMERS
The C62x/C67x has two 32-bit general-purpose timers that can be used to: Time events Count events Generate pulses Interrupt the CPU Send synchronization events to the DMA controller The timer works in one of the two signaling modes depending on whether clocked by an internal or an external source. The timer has an input pin (TINP) and an output pin (TOUT). The TINP pin can be used as a general purpose input, and the TOUT pin can be used as a general-purpose output. When an internal clock is provided, the timer generates timing sequences to trigger peripheral or external devices such as DMA controller or A/D converter respectively. When an external clock is provided, the timer can count external events and interrupt the CPU after a specified number of events.
47
The C6713 processor includes two Multichannel Audio Serial Ports (MCASP). The MCASP interface modules each support one transmit and one receive clock zone. Each of the MCASP has eight serial data pins which can be individually allocated to any of the two zones. The serial port supports time-division multiplexing on each pin from 2 to 32 time slots. The C6713B has sufficient bandwidth to support all 16 serial data pins transmitting a 192 kHz stereo signal. Serial data in each zone may be transmitted and received on multiple serial data pins simultaneously and formatted in a multitude of variations on the Philips Inter-IC Sound (I2S) format. In addition, the MCASP transmitter may be programmed to output multiple S/PDIF IEC60958, AES-3, CP-430 encoded data channels simultaneously, with a single RAM containing the full implementation of user data and channel status fields. The MCASP also provides extensive error-checking and recovery features, such as the bad clock detection circuit for each high-frequency master clock which verifies that the master clock is within a programmed frequency range.
48
Binary Phase Shift Keying (BPSK) is implemented in C-programming in Code Composer Studio. In the BPSK the transmitter/ voice encoder section is implemented in real time signal. In the real time voice signal is given as input from microphone connected to mic input or through .Wav file which is given to appropriate DSK kit. In the BPSK technique all the necessary files are added to the C-code of the transmitter in order get activated of the transmission section. While transmitter section of the BPSK signal is created some of the files get created:1. File.pjt: to create and build a project named file 2. File.c: C source program 3. File.asm: assembly source program created by the user, by the C compiler, or by the linear optimizer 4. File.sa: linear assembly source program. The linear optimizer uses file.sa as input to produce an assembly program file.asm 5. File.h: header support file 6. File.lib: library file, such as the run-time support library file rts6700.lib 7. File.cmd: linker command file that maps sections to memory 8. File.obj: object file created by the assembler 9. File.out: executable file created by the linker to be loaded and run on the C6713 processor.
Some of the supporting files have to be added to C-code in order to get the code activated those are:ECE Department, Gitam University
49
1. C6713dskinit.c: contains functions to initialize the DSK, the codec, the serial ports, and for I/O. It is not included with CCS. 2. C6713dskinit.h: header files with function prototypes. Features such as those used to select the mic input in lieu of line input (by default), input gain, and so on are obtained from this header file (modified from a similar file included with CCS). 3. C6713dsk.cmd: sample linker command file. This generic file can be changed when using external memory in lieu of internal memory. 4. Vectors_intr.asm: a modified version of a vector file included with CCSto handle interrupts. Twelve interrupts, INT4 through INT15, are available, and INT11 is selected within this vector file.They are used for interrupt-driven programs. 5. Vectors_poll.asm: vector file for programs using polling. 6. Rts6700.lib,dsk6713bsl.lib,csl6713.lib: run-time, board, and chip support library files, respectively. These files are included with CCSand are located in C6000\cgtools\lib, C6000\dsk6713\lib, and c6000\bios\lib, respectively.
50
In BPSK the voice signal is passed through Mic input or Line IN input through one DSK kit and a stereo cable is used to pass the signal from one DSK kit of Transmitter section to another DSK Kit of the receiver section. At the same time Ccode is dumped into the DSK kit of the transmitter section from the system.
51
In the receiver section side a C-Code is implemented and through DSK kit it is passed. At the same time the transmitted signal is passed to the receiver DSK kit. The receiver output is connected to the speaker. The input is low pass-filtered, decimated, and converted to an 8-bit stream. The bit stream is then modulated as a BPSK signal, and four output samples are generated for each bit. Each sample of the voice is a 16-bit integer. Because of sampling rate limitations, only the most significant 8 bits are used for transmission. This yields a resolution of 256 sample levels for the amplitude of the voice, which results in some degradation in the fidelity of the received signal. The procedure is to sample the voice, get the most significant 8 bits, then transmit one period of a sine wave for each bit. Each period of a sine wave is constructed by out putting to the D/A converter four values of the sine wave. Therefore, for one voice sample, 30 output samples are necessary. This is a severe limitation since the maximum sampling rate is 96kHz.The maximum sampling rate of the voice that we can implement is then 96 kHz/32, or 3kHz. The receiver uses eight samples to determine the phase of the phase-locked loop component allowing for a 48-kHz sampling rate by the transmitter. It can be verified that the receivers voice bandwidth is approximately 3kHz. To reconstruct a byte, the receiver must know where the frame starts for each byte. The transmitter periodically sends a synchronization sequence that is 1 byte long. This occurs once every 100 bytes. To achieve frame synchronization, a synchronization sequence is sent periodically by the transmitter. This sequence is 8 bits long and is detected by the receiver by correlating the incoming bits with the expected sequence. A trigger variable looks over the previously received 8 bits and counts the number of bits that match the synchronization sequence. If the trigger variable is equal to 8, then the synchronization sequence was detected. With 8 bits in the synchronization sequence, there are 256 possible values, so that there is a 1/256 possibility that the sequence will occur randomly. This is too high a probability, and since we are receiving bits at 12kHz (96kHz/eight
ECE Department, Gitam University
52
samples per bit), we would expect the sequence to occur randomly about 47 times a second (12 kHz/256). To lower this rate, we make sure that successive synchronization sequences are separated by the expected interval before declaring that the sequence has actually been received. When a correlation is detected, the frame index is reset to zero. Since the receiver is reconstructing voice samples at a rate of 64kHz, it needs to interpolate received voice samples to provide the DAC with a sample every time and the original signal is obtained.
53
54
RESULTS
In the project DSP PROCESSOR IMPLEMENTATION OF A MODEM FOR NARROW BANDWIDTH CHANNEL we had implemented different techniques and obtained results for them in mat lab and Code Composer Studio (CCS). In mat lab simulation are done for different techniques those are Binary Phase shift Keying (BPSK), Quadrature Phase Shift Keying (QPSK) and Quadrature Amplitude Modulation (QAM). For each technique outputs are shown above. Quadrature Phase shift keying (QPSK) technique simulation which are shown by taking digital bits and obtain the outputs for them and the same time for random bits also simulation has been done. For Quadrature Amplitude Modulation (QAM) technique simulation are done by taking all the internal blocks and obtained the output. Simulations which are done for 4QAM technique and outputs are shown for them. Simulations are shown in mat lab for this technique. In DSP Processor implementation we had done the Binary Phase Shift Keying (BPSK) technique. We had implemented the technique in C-Code which is done in Code Composer Studio (CCS) and it is implemented in DSK kit and obtained the output. Finally, I conclude that we had obtained the required outputs in both mat lab and Code Composer Studio (CCS).
55
Results for BPSK modulation/demodulation technique for random bit stream in MATLAB. The plot shows the transmitted and received waveform of the BPSK technique. The Blue color signal shows the transmitted signal and Red color signal shows the received signal.
Transmitted and Received signals 3 Transmitted Waveform Received Waveform
-1
-2
-3
-4 0
10
20
30
40
50
60
70
80
90
100
56
This plot shows the false and error detection region of the BPSK technique which is present. In the region the blue dots shows there are no errors in the region which means that the above obtained BPSK output waveform is correct.
Detections and decision regions 30
20
10
-10
-20
-30 -30
-20
-10
10
20
30
57
Results for BPSK modulation technique for random bit stream in MATLAB for .Wav file. This plot shows the received waveform and BPSK signal waveform in Amplitude versus Sample. In the received waveform graph it shows the variation in Amplitude with change in sample value.
R e c e ive d W a ve fo rm 100 Amplitude 50 0 -5 0 -1 0 0 -4 0 -3 0 -2 0 -1 0 10 20 30 40 S a m p le B P S K s ig n a l o f t h e fo rc e . w a v 0 50
1 0.5 Amplitude 0 -0 . 5 -1
Tra n s m it t e d B it s 1 1 1 0 1 0 0 0
1460 1470 1480 1490 1500 1510 1520 1530 1540 1550 1560 S a m p le
58
Results for QPSK modulation technique for digital bit stream in MATLAB. The outputs which are shown for digital bits stream. The input waveform shows the digital bits in terms of Amplitude form. The In-Phase channel waveform shows the real part of the signal. The Quadrature channel waveform shows the imaginary part of the signal. This plot shows the input, in phase and quadrature waveform in terms of Amplitude versus Time.
I p t Wv f r n u aeom Amplitude 1 0 1
00 .0 2
00 .0 4
00 .0 6
00 .0 8
01 .0
01 .0 2
01 .0 4
01 .0 6
01 .0 8
02 .0
I - h s Ca n l Wv f r np a e h n e aeom Amplitude 1 0 1
00 .0 2
00 .0 4
00 .0 6
00 .0 8
01 .0
01 .0 2
01 .0 4
01 .0 6
01 .0 8
02 .0
00 .0 2
00 .0 4
00 .0 6
00 .0 8
01 .0 T e im
01 .0 2
01 .0 4
01 .0 6
01 .0 8
02 .0
59
This plot shows the in phase, quadrature and QPSK waveform for analog form in terms of Amplitude versus Time. The In-Phase channel modulated waveform in analog form. Quadrature channel modulated waveform shown in analog form. The QPSK waveform which is shown from the digital bits which are given.
0.002
0.004
0.006
0.008
0.01
0.012
0.014
0.016
0.018
0.02
0.002
0.004
0.006
0.008
0.01
0.012
0.014
0.016
0.018
0.02
0.002
0.004
0.006
0.008
0.01 Time
0.012
0.014
0.016
0.018
0.02
60
This plot shows the QPSK spectrum in terms of linear and Db form in terms of Magnitude and Fequency. In QPSK spectrum in linear form which shows the rise in magnitude at 1 KHz range and in the same way the QPSK spectrum in Db form there is a rise in lobe in magnitude at 1 KHz range.
-3
2 1.5 1 0.5 0
x 10
Magnitude
500
1000
1500
3000
3500
4000
-50
Magnitude
-100
-150
-200
500
1000
1500
2000 Frequency
2500
3000
3500
4000
61
This plot shows the digital and analog form of input data, in phase, Quadrature channel waveform and QPSK waveform. The QPSK output waveforms for random bit streams in digital and analog format. The input which are given in terms of signals. The input data, In-phase channel data and Q-channel data which is shown in digital form. The I channel modulated, Q channel modulated and QPSK waveform which are shown in digital form. The waveforms are shown in terms of Amplitude versus Time.
-2 0.498
0.499
0.5
0.501
-2 0.498
0.499
0.5
0.501
0.502 Time
0.499
0.5
0.501
0.502 Time
62
This plot shows the frequency domain plots and modulated carrier of QPSK in terms of Amplitude and Frequency. The frequency domain plot of the signal where it is the carrier signal of the QPSK technique. The same QPSK carrier modulated technique shown in terms of Db.
F re q u e n c y d o m a in p lo t s 1 A M P LIT U D E 0 .5 0 -0 .5 4 5 0 04 6 0 04 7 0 04 8 0 04 9 0 05 0 0 05 1 0 05 2 0 05 3 0 05 4 0 05 5 0 0 M o d u la t e d Q P S K c a rrie r 0 -2 0 -4 0 -6 0 -8 0 4 0 0 04 2 0 04 4 0 04 6 0 04 8 0 05 0 0 05 2 0 05 4 0 05 6 0 05 8 0 06 0 0 0 F R E Q U E N C Y (H z )
DB
63
This plot shows the received data, filtered I, Q channels and unfiltered I,Q channels of data in terms of Time. The received data of signal, unfiltered I,Q channel outputs where some internal noise or errors are present in the signal. The I,Q channel data outputs are filtered to some extent in order to avoid errors. The output phase deviation signal is also shown.
0.2 0 -0.2
1 0 -1
0.5
0.5 T e im
64
This plot shows the Bit Error Rate (BER) for QPSK and BPSK techniques where the error rate is seen whether it is altered or not due to noise and distortions. The Bit Error Rate of the two modulation techniques where the error rate is seen whether it is altered or not due to noise and distortions. In figure we can seen the QPSK simulated output and QPSK theoretical output and BPSK theoretical output.
10
Simulation of symbol and bit BER for QPSK and BPSK QPSK Simulated QPSKsymbol Theoretical BPSKbit Theoretical
10
-2
10 BER 10
-4
-6
10
-8
10
-10
6 SNR(dB)
10
12
65
Results for QAM technique for random sequence in MATLAB. This plot shows the 4-QAM constellation diagram. The 4-QAM signal constellation diagram. In the result total 8 bits of information is obtained. The bits are 00,01,10,11 are obtained.
The Signal Constellation 0.8 0.6 0.4 0.2 0 -0.2 -0.4 -0.6 -0.8 -0.8
-0.6
-0.4
-0.2
0.2
0.4
0.6
0.8
66
This plot shows the pulse shaped signal of real part of sequence and power spectral density (PSD) is shows the power carried out by wave in terms of frequency. The symbols cannot be transmitted in right way. In order to transmit they need to be up sampled. The pulse shaping is in fact amplitude modulation. The spectral density represents the power carried out by the wave by multiplying with appropriate factor. The real part of pulse shaped signal represented in terms of Time and power spectral density of pulse shaped signal is represented in terms of PSD and Frequency.
R e a l P a rt o f s o m e o f th e P u ls e S h a p e d S ig n a l 1 0.5 0 -0 . 5 -1 0.0 5
0.1
0.15
0.2
2 PSD
100
200
600
700
800
67
This plot shows the error over time of the signal and output of equalizer which is obtained. If the signal has slow decrease as there is change in frequency to low value shows the error over time is getting reduced. The output of equalizer shows the 4-QAM constellation signal output which shows there is no error in the equalizer.
E rro r o ve r t im e 0 .8 0 .6 0 .4 0 .2 0
500
1000
1500
2000
2500
3000
3500
O u t p u t o f E q u a liz e r 1 0.5 0 -0 . 5 -1 -1
68
This plot shows the error of the signal and constellation waveform of technique. The result shows the rise value for spectrum and also the constellation diagram is obtained.
0.5
-0 . 5 1
1.5
3.5
4.5
5 .5
-1
69
This plot shows the timing offset and the signal and convergent eye diagram of the technique which is obtained. The timing offset signal where for particular time signal is transmitted after the time offset signal cannot get transmitted. The convergent diagram shows the 4-QAM constellation diagram of the signal.
T im in g O ffs e t 0 .6 0 .4 0 .2 0 -0 . 2 0
500
1000
1500
2000
2500
3000
3500
4000
C o n ve rg e n t E y e D ia g ra m 1 0.5 0 -0 . 5 -1 -1
70
This plot shows the jitter waveform of the signal whether any noise or distortion is obtained. The Power Spectral Density of jitter shows the no distortions in the signal. The jitter waveform represents the whether there is noise or distortion in the signal. The waveform shows the signal at zero level which represents there is no distortion in the signal.
P S D o f t h e t im in g J it t e r 1 0 .8 0 .6 0 .4 0 .2 0 -0 .2 -0 .4 -0 .6 -0 .8 -1 0
50
100
150
200
250
300
350
400
71
This plot shows the received signal and decision device recovery signal which shows there is no error in the signal for transmitted and received signal. The signal is obtained at zero level. The decision recovery represents the there is no error in the transmitted signal and received signal when difference is taken between them. The optimal equalizer shows the output of equalizer whether there are errors or not.
re c e ive d s ig n a l 2 1 0 -1 -2 2 1 0 -1 -2
o p t im a l e q u a liz e r o u t p u t
c o m b in e d c h a n a n d o p t e q im p re s p d e c is io n d e vic e re c o ve ry e rro r 1 1 0 .5 0 0 -0 . 5 -1
0 .5
-0 . 5 0
Figure 7.17: Received signal and Decision device recovery error Waveform
72
This plot shows the BPSK Technique output which is obtained in CCS where the display size, sampling rate values are changed. the C code output of BPSK technique represented in Code Composer Studio (CCS). The C-code is dumped in DSK kit TMS320c6713.The Line out pin through which the signal output is given to Line In with the help of stereo cable and demodulation takes place. In the Graphical display unit we will change the values of size, acquisition display, sampling rate of the technique. We obtained the required output for BPSK technique.
73
CONCLUSION
Finally, The project DSP PROCESSOR IMPLEMENTATION OF A MODEM FOR NARROW BANDWIDTH CHANNEL is done using different techniques in mat lab and Code Composer Studio (CCS). In mat lab we had implemented in Binary Phase shift Keying (BPSK), Quadrature Phase shift keying (QPSK) and Quadrature Amplitude Modulation (QAM). In Code Composer Studio (CCS) we had implemented in C code. The C-code is implemented in DSK processor in TMS320C6713 and obtained required outputs. In the project we implemented different techniques for obtaining the outputs in mat lab and Code Composer Studio (CCS). For each technique we had done the simulation in mat lab and check the performance of the technique. All the techniques are done by considering the internal blocks and obtain the simulation for them. In mat lab we simulated the different techniques for getting the outputs for modulation and demodulation side. Simulation are done in mat lab and shown above for random bits operation of signals.
A simple transmission/reception scheme intended for voice transmission is consists of one microphone; a DSP board for voice acquisition, sampling, coding and modulation; a channel; a second DSP board for voice processing or signal decoding, demodulation and voice reconstruction; a loudspeaker; and finally two PCs that control each DSP. DSP processor TMS320c6713 used for obtaining of the output for C code of BPSK technique.
74
APPENDIX
75
APPENDIX I
This appendix serves the information about the formulas and the coding or programming section implementation that are accessed in mat lab. In this section I am going to show the mat lab code of BSPK modulation technique that is implemented for getting the output.
76
title('Detections and decision regions') hold on; axlim = 30; axis([-axlim axlim -axlim, axlim]) plot([0 0],[-axlim axlim], 'k') x=received_sig - signal; n_errors = sum(and(x,1)) p_error = n_errors / N wavwrite(m_sig,5500,16,'bpsk.wav') wavwrite(r,5500,16,'bpsk_n.wav')
77
78
APPENDIX III
This appendix serves the information about the next modulation technique QPSK that is used and the mat lab outputs that are obtained.
%M = number of samples per bit duration. %tb=0.0020;tc=1.000e-003 %Nc = number of samples per period of carrier. %step = sampling interval. %step=6.2500e-005 % 10 positions % 1 1 0 0 1 0 1 0 1 1 % 32 columns
% -1
-1
-1
-1
-1
1
79
for i = 1:2*M % 64 columns for samples mi((j-1)*2*M+i)=1; si((j-1)*2*M+i)=Ac*cos(2*pi*(i-1)/Nc); end else for i = 1:2*M mi((j-1)*2*M+i)=-1; % 32 96 160 224 288 si((j-1)*2*M+i)=Ac*cos(2*pi*(i-1)/Nc+pi); end end if d(j*2) == 1
% (2 4 6 8 10 positions; 1
1)
for i = 1:2*M % 64 coulmns mq((j-1)*2*M+i)=1; sq((j-1)*2*M+i)=Ac*sin(2*pi*(i-1)/Nc); end else for i = 1:2*M mq((j-1)*2*M+i)=-1; sq((j-1)*2*M+i)=Ac*sin(2*pi*(i-1)/Nc+pi); end end end for k=1:M*N t(k)=(k-1)*step; % s(k)=si(k)+sq(k); end figure subplot(3,1,1) plot(t,m,'LineWidth',3) grid %xlabel('Time') ylabel('Amplitude') title('Input Waveform') subplot(3,1,2) plot(t,mi,'LineWidth',3) grid %xlabel('Time') ylabel('Amplitude') title('In-phase Channel Waveform') subplot(3,1,3) plot(t,mq,'LineWidth',3) grid xlabel('Time') ylabel('Amplitude')
ECE Department, Gitam University
80
title('Quadrature Channel Waveform') figure subplot(3,1,1) plot(t,si) grid %xlabel('Time') ylabel('Amplitude') title('Inphase Channel Modulated Waveform') subplot(3,1,2) plot(t,sq) grid %xlabel('Time') ylabel('Amplitude') title('Quadrature Channel Modulated Waveform') subplot(3,1,3) plot(t,s) grid xlabel('Time') ylabel('Amplitude') title('QPSK Waveform') %Spectrum of QPSK M1=64; %M1 = number of points per lobe. fstep=fb/M1; %fstep = freq. step. %7.8125 Nf=floor((fend-fstart)/fstep); %Nf = total number of freq. points computed. Nf=512 for i = 1:Nf f(i)=(i-1)*fstep+fstart; %fi= 1.0e+003 if f(i) == fc S(i)=Ac^2*tb; %0.0020 else S(i)=(Ac^2*tb)*(sin(pi*(f(i)-fc)*2*tb)/(pi*(f(i)-fc)*2*tb))^2; %0.0020*0 end end for i = 1:Nf dBS(i) = 10*log(S(i)); %62.1461 DB value is obtained if dBS(i) < -200 dBS(i)=-200; end end figure subplot(2,1,1) plot(f,S) grid xlabel('Frequency') ylabel('Magnitude') title('QPSK Spectrum (Linear)') subplot(2,1,2) plot(f,dBS) grid xlabel('Frequency')
ECE Department, Gitam University
81
82
APPENDIX IV
MATLAB CODE FOR QPSK:clear; fcarr=5e3; N=8; fs=20*1e3; Fn=fs/2; Ts=1/fs; T=1/N; randn('state',0); td=[0:Ts:(N*T)-Ts]'; data=sign(randn(N,1))'; data1=ones(T/Ts,1)*data; data2=data1(:); -------------------------------------------------------------------------------------------%display input data bits in command window -------------------------------------------------------------------------------------------data_2=data2'; data_2=data_2 >0; Transmitted_data_bits=data_2(1:(fs)/N:end) ------------------------------------------------------------------------------------------%Serial to parallel (alternating) ------------------------------------------------------------------------------------------tiq = [0:Ts*2:(N*T)-Ts]'; symbols(transpose) bs1=data(1:2:length(data)); symbols=ones(T/Ts,1)*bs1; Isymbols=symbols(:); bs2=data(2:2:length(data)); symbols1=ones(T/Ts,1)*bs2; Qsymbols=symbols1(:);
ECE Department, Gitam University
% Carrier frequency(Hz) % Number of data bits(bit rate) % Sampling frequency % Nyquist frequency % Sampling time = 1/fs % Bit time % Keeps PRBS from changing on reruns % Time vector(data)(transpose) %transpose
%transpose
Time
vector
for
and
%generate carrier waves twopi_fc_t=(1:fs/2)*2*pi*fcarr/fs; a=1; %phi=45*(pi/180) phi=0; cs_t = a * cos(twopi_fc_t + phi); sn_t = a * sin(twopi_fc_t + phi); cs_t=cs_t';%transpose sn_t=sn_t';%transpose si=cs_t.*Isymbols; sq=sn_t.*Qsymbols; sumiq=si+sq; sumiq=.7*sumiq; ht=(1/rc).*exp(-tiq/rc); ycfo=filter(sig_rx,1,ht)/fs; Bit_rate=N QFilterfreg_3dB=1/(2*pi*rc) pt1=1.7e-8; triggers H=5;%(volts) L=0;%(volts) LEN=length(ycfo); for ii=1:LEN; if ycfo(ii)>=pt1; setting pv1i(ii)=H; else; pv1i(ii)=L; end; end ; po1i=pv1i; %pulse out=pulse voltage %I pulse voltage %correlated output(ycfo) going above pt1 threshold %sets level where threshhold device comparator %multiply I bitstream with cosine %multiply Q bitstream with sine %transmitter output %reduce gain to keep output at +/- one %impulse response %phase error
84
pt2=1.7e-8; triggers H=5;%(volts) L=0; LEN=length(ycfo1); for ii=1:LEN; if ycfo1(ii)>=pt2; setting pv2q(ii)=H; else; pv2q(ii)=L; end; end ; po1q=pv2q; bit1=sign(po1q); bit2=sign(po1i); bit3=bit1 >0; bit4=bit2 >0; bitout=[bit3]; bitout1=[bit4]; bitout2=[bitout]; x=1128;%x=fs/N; . fs:x=(8*2641)-20000=1128 bitout2=bitout2(1:(fs+x)/N:end); bitout2=[bitout2]; bitout3=[bitout1]; bitout3=bitout3(1:(fs+x)/N:end); bitout3=[bitout3]; bitfinalout=[bitout2;bitout3]; bitfinalout=bitfinalout(1:end);
%(volts)
85
%display received output data bits in command window ----------------------------------------------------------------------------------Received_data_bits=bitfinalout %Received data output data1a=ones(T/Ts,1)*bitfinalout; bitfinal1=data1a(:); bitfinal1=bitfinal1-mean(bitfinal1); bitfinal1=2*bitfinal1;%get to +/- 1 figure(1) subplot(3,2,1) plot(td,data2) axis([0 1 -2 2]); grid on xlabel('Time') ylabel('Amplitude') title('Input Data') subplot(3,2,3) plot(tiq,Isymbols) axis([0 1 -2 2]); grid on xlabel(' Time') ylabel('Amplitude') title('I Channel(one bit/symbol(phase)) Data') subplot(3,2,5) plot(tiq,Qsymbols) axis([0 1 -2 2]); grid on xlabel(' Time') ylabel('Amplitude') title('Q Channel(one bit/symbol(phase)) Data') subplot(3,2,2) plot(tiq,si)
ECE Department, Gitam University
86
axis([.498 .502 -2 2]); grid on xlabel(' Time') ylabel('Amplitude') title('I Channel Modulated Waveform') subplot(3,2,4) plot(tiq,sq) axis([.498 .502 -2 2]);
87
APPENDIX V
This appendix serves the information about the next modulation technique QAM that is used and the mat lab outputs that are obtained. In this section we will see the QAM Matlab code:clear all close all n=input('enter largest equalizer delay (try 3)= '); el=n+1; --------------------------------------------------------------------------------------------%maximum delay candidate (> ch dim + eq max delay); --------------------------------------------------------------------------------------------alph=chdim+n+1; --------------------------------------------------------------------------------------------%select training sequence length --------------------------------------------------------------------------------------------p=input('enter training/source sequence length (try 4000) = '); --------------------------------------------------------------------------------------------%set up time vector --------------------------------------------------------------------------------------------time=[1:p]; --------------------------------------------------------------------------------------------%make Toeplitz input matrix for channel --------------------------------------------------------------------------------------------toprowc=fliplr(s(1:chdim)); lcolc=s(chdim:p).'; Ach=toeplitz(lcolc,toprowc); sg=input('enter sinusoidal interferer gain (try 0.1) = '); om=input('enter sinusoidal interferer frequency (try 1.4) = '); ng=input('enter uniform channel noise -/+ max magnitude (try 0.04) ='); tpars=sqrt((1-ng*(ng/3)-0.5*sg*sg)/(rawtp'*rawtp))*rawtp;
ECE Department, Gitam University
88
rsig=Ach*tpars; d=zeros(size(rsig)); for i=1:length(rsig), d(i,1)=sg*sin(om*(i-1))+ng*2*(rand-0.5); end r=(rsig+d)'; --------------------------------------------------------------------------------------------%calculate MMSE equqlizer --------------------------------------------------------------------------------------------cosvec=cos(om*[0:(el-1)])'; V=toeplitz(cosvec); isnr=(ng^2)/3; C=convmtx(tpars,el); %interference matrix %inverse of source to noise variance ratio %channel convolution matrix
CC=C'*C+isnr*eye(el)+0.5*(sg^2)*V; foptmat=pinv(CC)*C'; %pseudoinverse of (C'C+ isnr*I) [mmse,optind]=min(diag(eye(size(C*foptmat))-C*foptmat)); %value and index of min entry of I - C*foptmat mmse_w_opt_delay=mmse delt=optind-1; optimum_delay=delt fopt=foptmat(:,optind); combo=conv(fopt,tpars); %channel and MMSE equalizer combination toprowrbar=fliplr(r(alph-chdim-n+2:alph-chdim+2)); lcolrbar=r(alph-chdim+2:p-chdim+1); Rbar=toeplitz(lcolrbar,toprowrbar); y=Rbar*fopt; subplot(2,2,4) axis('normal') ww=[0:pi/100:pi]; [fradin]=freqz(conv(tpars,thet(:,strt)),1,ww); [fras]=freqz(conv(tpars,thet(:,itno)),1,ww); plot(ww,20*log10(abs(fras)),'.', ww,20*log10(abs(frcod)),'-',...
ECE Department, Gitam University
89
ww,20*log10(abs(fradin)),'--') title('Combo Freq Resp Magnitude') ylabel('db') xlabel('radians') figure(3) hold on axis equal plot(thet(1,strt:itno-1),thet(2,strt:itno-1)) plot(thet(1,strt),thet(2,strt),'o') plot(thet(1,itno),thet(2,itno),'s') xlabel('f0') ylabel('f1') hold off adapt=input('enter 0 to stop or 1 to adaptively equalize = '); end %adap fin: dot, adap init: dash, opt:solid
90
APPENDIX VI
This appendix serves the information about C Code of BPSK technique in Code Composer studio (CCS) software.
91
else output_sample(0); //0if MAX_DATA_LENGTH exceeded r[rNum++] = (short) input_sample(); //input signal buffer[buflen++] = r[rNum - 1]; if(beginDemod) //demod received signal { if(decSeqNum<2 && rNum==N) { //account for delay in signal decSeqNum ++; rNum = 0; } if(rNum == N) //synchronize to symbol length { rNum = 0; for(i=0; i<N; i++) //correlate with basis function X += r[i]*phi_1[i]; decodeSeq[decSeqNum-2] = (X >= 0) ? 1: 0; //do detection if(++decSeqNum == MAX_DATA_LENGTH+2) //print received sequence { for(i=0; i<decSeqNum-2; i++) printf("Received Value: %d\n", decodeSeq[i]); exit(0); } } } else { beginDemod = 1; rNum = 0; } } void main() { int i; comm_intr(); //init DSK, codec, McBSP for(i=0; i<=N; i++) phi_1[i] = sin(2*PI*i/N); //basis function while(1); //infinite loop }
92
Single and multiple carrier quadrature amplitude modulation by L.Hazo, W.Webb, and T.Keller.
4. 5.
Communication systems by simon Haykins DSP for MAT LAB: Fundamentals of Discrete Signal Processing by ForesterW. Isen
6. 7. 8. 9.
Digital signal processing by John G. Proakis, Dimitris K Manolakis The scientists of engineers guide in Digital signal processing by Steven W. smith
J. Proakis, Digital Communications, 5th Edition, 2008, McGraw Hill Higher Education. M.K. Simon, S.M. Hinedi, and H.C. Lindsey, Digital Communication Techniques Signal Design and Detection, New Jersey: Prentice Hall, 1995.
10. Dr. M. Fitton, Principles of Digital Communication, Telecommunications Research Lab, Toshiba Research Europe Limited.
11. C. Britton Rorabaug, Simulating Wireless Communication Systems: Practical Models in
C++, 2004, Prentice Hall. 12. TMS320C67x DSP Library Programmer's Reference Guide.
93
13. Digital Modulation in Communication Systems An Introduction, Application Note 1298, Hewlett Packard.
14.
Stearns Samuel.D Digital Signal Processing With Examples in Matlab, 2nd Edition; CRC
15. 16.
Madisetti V.K., The Digital Signal Processing 2nd Edition, CRC 2008. Gallager R. Principles of Digital Communication, Cambridge University Press 2008.
94