Speaker Recognition using Matlab

Ø ABSTRACT:
           ·        The project recognizes the input data spoken by the speaker by comparing it with the reference data.
·        It involves having Fast Fourier transform of the given speech then normalizing the frequency signal.

           ·        Finally, the reference and the given data are compared and the result is displayed depending on the variation in the input speeches. 

Ø WORKING OF MODEL: 


Ø MATLAB CODING:
Ø  Coding for Input:-
data=data(1:600);
fy=fft(data);
fy=fy.*conj(fy);
tn=fy/sqrt(sum(abs(fy).^2));

Ø  Coding for Comparasion:-
s=sqrt(sum(abs(f-d).^2));
if s<2*1
    result=strcat('HELLO!!!');
    result
else
    result=strcat('YOU ARE NOT');
    result
end

Continue Reading

Implement Electronic Lock using IC 555


Abstract:
§ Three switches are put in series
§ Another three switches are put in parallel
§ Pressing all the three series switches opens the lock else, LED does not glow
§ The IC is responsible for the time delay
§ Pressing  any one of the three parallel switches, instantaneously short circuits the capacitor, thus stopping the functioning of the LED.

Circuit Diagram:
§W
Working:
§ There are six (or more) push switches. To 'unlock' you must press all the correct ones at the same time.
§ But do not press any of the cancel switches. Pressing just one cancel switch will prevent the circuit
§ Unlocking:- When the circuit unlocks it actually just turns on an LED for about one second, but it is  intended to be adapted to turn on a relay which could be used to switch on another circuit.

§
§
Continue Reading

PCM and DPCM using SIMULINK


  • AIM:

To generate a Pulse Code Modulation using simulink.


  • SOFTWARE REQUIRED:

1.Matlab
2.Simulink


  • BLOCKS REQUIRED:

1. Sine wave generator
2. Pulse generator
3. Product
4. Quantizer
5. Encoder
6. Integer to bit converter
7. Scope

  • BLOCK DIAGRAM for PCM:




  • OUTPUTS OBTAINED:

quantized output

encoded output


PCM


  • BLOCK DIAGRAM FOR DPCM:

  • OUTPUTS OBTAINED:

after introducing a delay element

quantization

encoded signal


  • INFERENCE

Pulse Time Modulation is also known as Pulse Width Modulation or Pulse Length Modulation. In PWM, the
samples of the message signal are used to vary the duration of the individual pulses. Width may be varied by
varying the time of occurrence of leading edge, the trailing edge or both edges of the pulse in accordance with modulating wave. It is also called Pulse Duration Modulation.

Continue Reading

Basic Programs used in Digital Signal Processing using MATLAB

%Unit step%
n=-99:1:100;
u=[zeros(1,100) ones(1,100)];
plot (n,u);
stem (n,u);

%Ramp%
n1=input('enter the limit');
n2=0:n1;
stem(n2,n2)

%real exponential%
n=0:35;
a=1.2;
k=.2;
x=k*a.^+n;
stem (n,x);

%complex exponential%
n=-10:1:10;
alpha=-.1+.3j;
x=exp(alpha*+n);
subplot(2,2,1);stem(n,real(x))
subplot(2,2,2);stem(n,imag(x))
subplot(2,2,1);stem(n,abs(x))
subplot(2,2,1);stem(n,(180/pi)*angle(x))

%sine wave%
t=0:.01:1;
x=sin(2*pi*t);
plot(t,x);
stem(n,x);
Continue Reading

Impulse Response, Step Response, DFT, IDFT, DTFT, IDTFT MATLAB code

%impulse and step response%
sys=tf([1],[1 4 3]);
subplot(2,1,1); step(sys);
ylabel('amplitude');
xlabel('time in seconds');
subplot(2,1,2); impulse(sys);
ylabel('amplitude');
xlabel('time in seconds');

%DFT%
x=input('enter the input matrix: ');
mul=(-2)*j*pi;
xlen=length(x);
for k=0:xlen-1
    y(1,k+1)=0;
    for n=0:xlen-1
        y(1,k+1)=y(1,k+1)+x(1,n+1)*exp(mul*n*k/xlen);
    end
end
nm=1:xlen;
subplot(2,1,1); stem(nm,real(y),'fill')
title('real part');
subplot(2,1,2); stem(nm,imag(y),'fill')
title('imaginary part');

%IDFT%
x=input('enter the input matrix');
mul=(2)*j*pi;
xlen=length(x);
for n=1:xlen-1
    y(1,n+1)=0;
    for k=1:xlen-1
        y(1,n+1)=y(1,n+1)+x(1,k+1)*exp(mul*n*k/xlen);
    end
    y(1,n+1)=y(1,n+1)/xlen;
end
nm=1:xlen;
subplot(2,1,1); stem(nm,real(y),'fill')
title('real part');
subplot(2,1,2); stem(nm,imag(y),'fill')
title('imaginary part');

%DFT and IDFT using matlab functions

x=input('Enter the sequence x(n)=');
N=input('Enter the length of the DFT N=');
X=fft(x)/N;
n=0:length(X)-1;
subplot(311);
stem(n,x);
title('Input Sequence');
subplot(323);
stem(n,X);
title('DFT');
subplot(324);
stem(n,abs(X));
title('Magnitude spectrum');
subplot(325);
stem(n,angle(X));
title('Phase spectrum');
xr=N*ifft(X);
subplot(326);
stem(n,abs(xr));
title('IDFT');

%DTFT and IDTFT%
 N=10;
w=0:0.01*pi:2*pi;
dtft=N.*sinc(w.*N./2./pi)./(sinc(w./2./pi)).*exp(-j.*w.*(N-1)./2);
subplot(2,1,1)
Mag=abs(dtft);
plot(w./pi,Mag);
subplot(2,1,2)
Pha=angle(dtft);
plot(w./pi,Pha);

Continue Reading

DFT without using MATLAB function

%DFT without using MATLAB function%
x=input('Enter the sequence x= ');
N=input('Enter the length of the DFT N= ');
len=length(x);
if N>len
    x=[x zeros(1,N-len)];
elseif N<len
    x=x(1:N);
end
i=sqrt(-1);
w=exp(-i*2*pi/N);
n=0:(N-1);
k=0:(N-1);
nk=n'*k;
W=w.^nk;
X=x*W;
disp(X);
subplot(211);
stem(k,abs(X));
title('Magnitude Spectrum');
xlabel('Discrete frequency');
ylabel('Amplitude');
grid on;
subplot(212);
stem(k,angle(X));
title('Phase Spectrum');
xlabel('Discrete frequency');
ylabel('Phase Angle');
grid on;
Continue Reading

FIR Low Pass Filter using inbuilt MATLAB function

%equiripple FIR filter
Fs=1000;
Fp=input('Input the pass band frequency Fp= ');
Fst=input('Input the stop band frequency Fst= ');
Ap=input('Input the pass band attenuation Ap= ');
Ast=input('Input the stop band attenuation Ast= ');
d=fdesign.lowpass('Fp,Fst,Ap,Ast');
Hd=design(d,'equiripple');
fvtool(Hd);

Continue Reading