37
0 1 2 3 4 5 6 7 8 9 10 0 0.5 1 n amplitude discrete unitstep sequence 0 1 2 3 4 5 6 7 8 9 10 0 0.5 1 1.5 2 n amplitude continuous unitstep signal

Mtechisem Lab

  • Upload
    rohith

  • View
    214

  • Download
    0

Embed Size (px)

Citation preview

0 1 2 3 4 5 6 7 8 9 100

0.5

1

n

ampl

itude

discrete unit step sequence

0 1 2 3 4 5 6 7 8 9 100

0.5

1

1.5

2

n

ampl

itude

continuous unit step signal

-5 -4 -3 -2 -1 0 1 2 3 4 50

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

n

ampl

itude

unit impulse sequence

0 1 2 3 4 5 6 7 8 9 10-1

-0.5

0

0.5

1

time

ampl

itude

sine signal

0 1 2 3 4 5 6 7 8 9 10-1

-0.5

0

0.5

1

time

ampl

itude

cosine signal

0 2 4 6 8 10 12-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

time

Am

plitu

desquare signal

0 1 2 3 4 5 6 7 8 9 10-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

time

Am

plitu

de

rectangular signal

0 5 100

5

10

time

Am

plitu

de

positive ramp signal

0 5 100

5

10

time

Am

plitu

de

positive ramp signal

0 5 100

5

10

time

Am

plitu

de

negative ramp

0 5 100

5

10

time

Am

plitu

de

negative ramp

0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1-1

-0.5

0

0.5

1

Time

Am

plitu

de

saw tooth wave

0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1-1

-0.5

0

0.5

1

time

ampl

itude

OUTPUT

0 5 10 15 20 25 30-1

0

1

Time Index t (sec.)

x1(

t)

Signal 1 : Sine Wave of Frequency 1/3 Hz

0 5 10 15 20 25 30-1

0

1

Time Index t (sec.)

x2(

t)

Signal 2 : Sine Wave of Frequency 1/5 Hz

0 5 10 15 20 25 30-2

0

2

Time Index t (sec.) y(t

) =

x1(

t) +

x2(

t) Resultant Signal : Signal 1 + Signal 2

OUTPUT

0 5 10 15 20 25 30-1

0

1

Time Index t (sec.)

x1(

t)

Signal 1 : Sine Wave of Frequency 1/3 Hz

0 5 10 15 20 25 30-1

0

1

Time Index t (sec.)

x2(

t)

Signal 2 : Sine Wave of Frequency 1/5 Hz

0 5 10 15 20 25 30-1

0

1

Time Index t (sec.) y(t

) =

x1(

t) .

* x2

(t) Resultant Signal : Dot Product of Signal 1 and Signal 2

OUTPUT

0 1 2 3 4 5 6 7 8 9 10-2

-1

0

1

2

Time Index t (sec.)

x(t

)

Signal 1 : Sine Wave of Frequency 1/5 Hz

0 1 2 3 4 5 6 7 8 9 10-2

-1

0

1

2

Time Index t (sec.)

y(t

)

Signal 2 : Scaled Version of Signal 1

OUTPUT

0 100 200 300 400 500 600 700 800 900 10000

0.2

0.4

0.6

0.8

nx

x(n

x)

Original Signal

-1000 -900 -800 -700 -600 -500 -400 -300 -200 -100 00

0.2

0.4

0.6

0.8

nf

xf(

nf)

Folded Signal

OUTPUT

1 1.5 2 2.5 3 3.5 40

2

4

samplesam

plitu

de

original signal

1 1.5 2 2.5 3 3.5 40

2

4

samples

ampl

itude

even part of sequence

1 1.5 2 2.5 3 3.5 4-2

0

2

samples

ampl

itude

odd part of sequence

OUTPUT

0 5 10 15 20 250

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

time n

ampl

itude

Energy of the signal (1/2).n

Output:

Type a value for N 1The calculated power of the signal

P =

0.3750

0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

time n

ampl

itude

input signal

Result: Hence the energy and power of the signal are calculated.

Output:Enter x[n]: [1 2 3 4]Enter h[n]: [1 2]Z= 1 4 7 10 8

0 0.5 1 1.5 2 2.5 30

2

4

Time

Am

plitu

de

Input sequence x[n]

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

1

2

Time

Am

plitu

de

Impulse response of the system h[n]

0 0.5 1 1.5 2 2.5 3 3.5 40

5

10

Time

Am

plitu

de

Linear Convolution

Output:enter x[n]: [1 2 3 4]Enter h[n]: [1 2]

xnew =

1 2 3 4 0

hnew =

1 2 0 0 0

xf =

10.0000 -4.0451 - 1.3143i 1.5451 - 2.1266i 1.5451 + 2.1266i -4.0451 + 1.3143i

hf =

3.0000 1.6180 - 1.9021i -0.6180 - 1.1756i -0.6180 + 1.1756i 1.6180 + 1.9021i

zf =

30.0000 -9.0451 + 5.5676i -3.4549 - 0.5020i -3.4549 + 0.5020i -9.0451 - 5.5676i

z = 1 4 7 10

0 0.5 1 1.5 2 2.5 30

2

4

time

Am

plitu

de

First sequence x(n)

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

1

2

time

Am

plitu

de

Second sequence h(n)

0 0.5 1 1.5 2 2.5 3 3.5 40

5

10

time

Am

plitu

de

Convolution

Result:The convolution of two sequences is done in time and frequency domain.

Output:Enter x[n] : [1 2 3 4]Rxx = 4.0000 11.0000 20.0000 30.0000 20.0000 11.0000 4.0000

0 0.5 1 1.5 2 2.5 30

1

2

3

4

Time

Am

plitu

deInput sequence x[n]

-3 -2 -1 0 1 2 30

10

20

30

Time

Am

plitu

de

Autocorrelation of x[n]

Output:Enter the first sequence x[n]: [1 2 3 4]Enter the second sequence y[n]: [5 6 7 8]

Rxy =

8.0000 23.0000 44.0000 70.0000 56.0000 39.0000 20.0000

0 0.5 1 1.5 2 2.5 30

2

4

Time

Am

plitu

de

Input sequence x[n]

0 0.5 1 1.5 2 2.5 30

5

10

Time

Am

plitu

de

Input sequence y[n]

-3 -2 -1 0 1 2 30

50

100

Time

Am

plitu

de

Cross correlation of x[n] and y[n]

Result: the autocorrelation and cross correlation of the signals is obtained.

Output:

enter pass band ripple 2enter stop band ripple 10enter pass band frequency 2000enter stop band frequency 8000

n =

1

wn =

1.6755e+004

b =

1.0e+004 *

0 1.6755

a =

1.0e+004 *

0.0001 1.6755

0 100 200 300 400 500 600 700 800 900 10000.98

0.99

1

1.01

normalised frequency

m

magnitude response

0 100 200 300 400 500 600 700 800 900 1000-0.2

-0.15

-0.1

-0.05

0

normalised frequency

a

phase reponse

Result: the response of butterworth low pass filter is obtained.

Output:enter pass band ripple 2enter stop band ripple 10enter pass band frequency 8000enter stop band frequency 2000

n =

1

wn =

3.7699e+004

b =

1 0

a =

1.0e+004 *

0.0001 3.7699

0 2000 4000 6000 8000 10000 12000 14000 160000

0.2

0.4

0.6

0.8

normalised frequency

m

magnitude response

0 2000 4000 6000 8000 10000 12000 14000 160000

0.5

1

1.5

2

normalised frequency

a

phase reponse

Result: the response of butterworth high pass filter is obtained.

Output:

Result:

Hence the IIR low pass filter is designed using Chebyshev approximations.

Output:

Result:

Hence the IIR high pass filter is designed using Chebyshev approximations.

Output:

Result:

Hence an FIR LPF is designed for the given specifications using different window

techniques.

Output:

Result:

Hence an FIR HPF is designed for the given specifications using different

window techniques.

OUTPUT

-0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

Time t (sec)

x(t)

Continuous time signal: x(t) = cos(2F1t) + cos(2F

2t)

-0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

Time Sample (n)

Am

plitu

de

Discrete Time Signal

Fs < 2Fmax

-0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

Time Sample (n)

Am

plitu

de

Discrete Time Signal

Fs > 2Fmax

-0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

Time Sample (n)

Am

plitu

de

Discrete Time Signal

Fs = 2Fmax

Result : Under sampling , Nyquist sampling and Over sampling have been observed.

Output:Enter the Decimation factor= 4

0 20 40 60 80 100 120-2

-1

0

1

2original signal

time n

Am

plitu

de

0 5 10 15 20 25 30-2

-1

0

1

2Decimated signal

time n

Am

plitu

de

Result: thus downsampling is performed on the signal with a factor of 4.

Output:Enter the interpolation factor= 4

0 5 10 15 20 25 30-2

-1

0

1

2original signal

time n

Am

plitu

de

0 20 40 60 80 100 120-2

-1

0

1

2Interpolated signal

time n

Am

plitu

de

Result: thus the signal is upsampled by a factor of 4.

Output:

enter the input frequency:100sampling frequency 500

0 0.05 0.1 0.15 0.2 0.25-70

-60

-50

-40

-30

-20

-10

0

Frequency (kHz)

Pow

er/f

requ

ency

(dB

/Hz)

Power Spectral Density Estimate via Periodogram

Result: The output is observed and the graphs are plotted.

OUTPUT:

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5-80

-70

-60

-50

-40

-30

-20

-10

Frequency (kHz)

Pow

er/f

requ

ency

(dB

/Hz)

Power Spectral Density Estimate via Periodogram

Result: The output is observed and the graphs are plotted.

OUTPUT:

enter the frequency of the signal: 100enter the sampling frequency: 500

0 0.05 0.1 0.15 0.2 0.25-30

-28

-26

-24

-22

-20

-18

-16

-14

-12

-10

Frequency (kHz)

Pow

er/f

requ

ency

(dB

/Hz)

Power Spectral Density Estimate via Welch

Result: hence the PSD is observed.

OUTPUT:

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-200

-100

0

100

Normalized Frequency ( rad/sample)

Pha

se (

degr

ees)

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-20

0

20

40

Normalized Frequency ( rad/sample)

Mag

nitu

de (

dB)

AR system frequency response

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-25

-20

-15

-10

-5

0

5

10

15

20

25

Normalized Frequency ( rad/sample)

Pow

er/f

requ

ency

(dB

/rad

/sam

ple)

Power Spectral Density Estimate via Yule-Walker

Result: the PSD is calculated.

OUTPUT:

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9-80

-60

-40

-20

0

20

40

60

80

normalised frequency

one

side

d ps

d

Power Spectral Density Estimate via Burg

psd of model output

psd estimate of x

Result : hence the PSD is calculated using Burg method.

Result: The forward predictor of the signal is obtained.