Popular Posts

Saturday, October 22, 2011

MATLAB Command Window

Command Window is characterised by the propmpt '>>'.

All Commands and the ready to run program filename can be typed here.

Graphic Window gives the display of the figures as the result of the program.

 

Tuesday, October 18, 2011

MATLAB Programs


GENERATION OF SIMPLE SIGNALS



%GENERATION OF SIMPLE SIGNALS


clc;
clear all;
close all;
%Unit Impulse Signal
t=-2:2;
y=[zeros(1,2),1, zeros(1,2)];
subplot(221);
stem(t,y);
xlabel('Time Index');
ylabel('Amplitude');
%Unit Step Sequence
n=input('Enter the
length of step sequence N = '
);
t=0:n-1;
y1=ones(1,n);
subplot(222);
stem(t,y1);
xlabel('Time Index');
ylabel('Amplitude');
%Ramp Sequence
n1=input('Enter the length of ramp sequence N = ');
t=0:n1;
subplot(223);
stem(t,t);
xlabel('Time Index');
ylabel('Amplitude');
n2=input('Enter the
length of exponential sequence N = '
);
t=0:n2;
a=input('Enter the
value of a = '
);
y2=exp(a*t);
subplot(224);
stem(t,y2);
xlabel('Time Index');
ylabel('Amplitude'); 


Enter the length of step sequence N = 8
Enter the length of ramp sequence N = 8
Enter the length of exponential sequence N = 8
Enter the value of a = -1

OUTPUT

 



AM GENERATION WITH DOUBLE SIDE BAND (DSB) AND SUPPRESSED CARRIER

%AM Wave DSB with carrier


clc;
clear all;
close all;
fc=input('Enter the carrier signal frequency in hz,fc = ');
fm=input('Enter the modulating signal frequency in hz,fm = ');
m=input('Modulation index,m= ');
n=0:0.001:1;
c=sin(2*pi*fc*n);%carrier signal
M=sin(2*pi*fm*n);% modulating signal
y=(1+m*M).*c;%AM signal
subplot(2,1,1);
plot(n,y);
ylabel('amplitude');
xlabel('time index');

%AM
with suppressed carrier
n=0:0.001:1;
c=sin(2*pi*fc*n);%carrier signal
M=sin(2*pi*fm*n);% modulating signal
y=M.*c;
subplot(2,1,2);
plot(n,y);
axis([0 1 -2 2]);
ylabel('amplitude');
xlabel('time index');



Enter the carrier signal frequency in Hz, fc = 50 
Enter the modulating signal frequency in Hz, fm = 5 
Modulating index, m = 0.5


OUTPUT



LINEAR CONVOLUTION USING BUILT IN FUNCTION




%Linear Convolution using built-in function

clc;
clear all;
close all;
x=input('Enter the input sequence x[n] = ');
lx=input('Enter the starting time index of x[n] = ');
h=input('Enter the input sequence h[n] = ');
lh=input('Enter the starting time index of h[n] = ');
y= conv(x,h);
n=lx+lh:length(y)+lx+lh-1;
stem(n,y);
ylabel('Amplitude');
xlabel('Time Index');
title('Linear Convolution');



Enter the input sequence x[n] = [1 2 3 4]
Enter the starting time index of x[n] = -2
Enter the input sequence h[n] = [3 3 4]
Enter the starting time index of h[n] = -1



SQUARE WAVE FROM SINUSOIDAL HARMONICS


%SQUARE WAVE FROM SINUSOIDAL HARMONICS

clc;
clear all;
close all;
y=0;
h=input('No of harmonics = ');
f=input('enter the frequency =');
t=0:0.005:1/f
for i=1:2:h
y= y+sin(i*2*pi*f*t)/i;
plot(t,y);
pause;
hold on;
end


No of harmonics = 20
enter the frequency =0.5








 
IMPULSE RESPONSE OF LTI SYSTEM 




%Impulse Response of LTI System

clc;
clear all;
close all;
N=input('Enter the required length of the impulse response, N = ');
b=input('Enter coeffecients of x[n], b = ')
a=input('Enter coeffecients of y[n], a = ')
x=[1, zeros(1, N-1)];
y=filter(b,a,x);
n=0:N-1;
stem(n,y);
xlabel('Time Index n');
ylabel('Amplitude');
title('Impulse response of the system');



Enter the required length of the impulse response, N = 40
Enter coeffecients of x[n], b = [ -0.8 -0.44 -0.36 -0.22]

b =

   -0.8000   -0.4400   -0.3600   -0.2200

Enter coeffecients of y[n], a = [1 0.7 -0.45 -0.6]

a =

    1.0000    0.7000   -0.4500   -0.6000



Monday, September 5, 2011

Smell Phones

Before moving to the concept of smell phones, 

A Brief Statistics on the use of mobile phones over the recent years .. 



  These were the usage statistics in India until 2011, taken with over a 56 crore mobile subscribers.

  The above details shows that mobile was mainly used for voice communication alone. But, with  the advent of technology, phones became much more interactive, ie smarter, it will take one to a world of different services and applications and smart phones became available.

 Cognitive Enabled Phones

 What is a cognitive enabled phone?????


  •  Currently smart phones offer a variety of services such as internet, VOIP, GPS, multimedia, video calling and a whole variety of different services. 
  • In addition to the services provided to the end-user, by smart phones, these type of phones will have the ability to interact with the surroundings. 
  •  They will produce some kind of response based on the input from the surroundings based on some policies, rules set forth by law.
  • In short, in addition to the facilities provided by the smart phones, cognitively enabled phones will have some sort of intelligence to interact with the surroundings.
One such example of a cognitive enabled device is the smell phone.
 Now,
 What is smell??????
  • Materials with temperatute above 273K emit different types of  radiations.

  • Chemicals in the materials may vaporise and they mix with the atmosphere around the material.

  • The odor of these chemicals is perceived as smell by our nose.  
 The block diagram of the Human Nasal System is as shown below 
  • Olfactory Receptor Cells are the ones responsible for the perception of smells from our surroundings.
  • These cells have Cilia at one end and Axons the other end.
  • Humans have over 4 crores of such cells for perceiving various smells. 
  • The number of cells do matter...(German Sheperds have 200 crores of such cells, thus they have more of such instincts than human beings)
  • These cells produce produce some kind of electric signals corresponding to the smell and these signals are transferred to the olfactory bulb.
  • These signals are transferred to Olfactory Cortex, Hypothalamus .etc by electro-chemical transmission within the cells.
  • The processing of these electric signals gives us the sense of smell.
  • The system responsible for perception of smells is the Limbic System.
  • An electronic device which is functionally similar to our nose is called Electronic Nose (E-Nose).