Friday, April 13, 2012

ASK Modulation & Demodulation using MATLAB


Amplitude Shift Keying:

Amplitude shift keying (ASK) is a very popular modulation used in control applications. This is due to its simplicity and low implementation costs. ASK modulation has the advantage of allowing the transmitter to idle during the transmission of a bit zero. Therefore this reduces the power consumption. This disadvantage of ASK modulation arises in the presence of an undesired signal. in amplitude shift keying (ASK), as the name specifies the amplitude of the carrier signal is varied between two levels if the ASK scheme is Binary ASK. Sometimes it is more than two levels if the ASK scheme is M-array. All this is done according to the data bit to be transmitted over the noisy channel. The information is assumed to be unipolar binary data. In binary ask bit 1 is transmitted with the carrier of specified amplitude. The bit zero is transmitted with the no carrier during the bit interval. During all the bit intervals amplitude will be changed but frequency will be kept constant. In M-array ask the amplitude levels of the carrier will change between M numbers of values. The main advantage of the ASK is power saving and simplicity in implementation. The ASK wave form can be represented mathematically as s(t)=m(t)*sin(2πfct). where s(t) is the ASK output signal, m(t) is the unipolar binary message signal to be transmitted and fc is the carrier frequency.Amplitude      shift keying (ASK) is a simple and elementary form of digital modulation in which the amplitude of a carrier sinusoid is modified in a discrete manner depending   on   the   value   of   a   modulating   symbol.This is a narrow band modulation scheme and we assume that a large number carrier cycles are sent within a symbol   interval. obvious that the information is embedded only in the peak amplitude of the modulated signal.this is described as a one type of digital amplitude modulation technique. BASK has only one basis function so this can be described as a one  dimensional modulation scheme.this technique is used for telegraph services.on-off keying is not a spectrally not efficeint scheme becuse as the amplitude of the carrier changes abruptly when the data bit changes. for this reason this technique is used for transmission of data at low or moderate data rates.

 Algorithm:

                The binary message to be transmitted is taken and it should be represented in a waveform so we can implement ask. Then generate the carrier it may be either sin or cos. After generating carrier multiply the carrier with the message point by point.
                in demodulation the code checks for the value and if the value matched during the all the bit interval then the value will be returned.

Matlab commands:

1.       K=Length(x)

It finds the length of the array x and returns its length as an integer.

2.       T=[0.01:0.01:k]

This specifies the time interval over which the carrier time period will be decided.

3.       Z=m.*c

This is matlab Command for point by point multiplication. Sometimes it generates errors if the m and c are not of same dimensions.
4.       M((i-1)*100+1:i*100)=a(i)
This applies the value of the message bit i during the specified interval.

5.       p = randperm(n)

Returns a random permutation of the integers 1:n.

6.       mod(1,randperm(n))

this command generates the n number of integers and all these having only two values. For example mod(1,randperm(5)) ans =[0     1     1     1     1]


program:

x=input('binary message signal')%binary message signal
l=length(x)%length of message
t=[0.01:0.01:l]%time scaling
c=cos(2*pi*t)%carrier signal
for i=1:1:l
    m((i-1)*100+1:i*100)=x(i)%loop to convert inputed sequence to pulsewave
end
a=c.*m
figure(1)
plot(m)
title('massage signal')
figure(2)
plot(a)
title('ASK Signal')
%%% ASK Demodulation envelope detection  without noise%%%
for i=1:1:(i*100)
    if a(i)==0
        r(i)=0
    else
        r(i)=1
    end
end
figure(3)
plot(r)
title('recovered signal')


No comments:

Post a Comment

DC motor control with Pulse Width Modulation Part 1

DC Motor intro DC motor is a device which converts electrical energy into kinetic energy. It converts the DC power into movement. The typica...