You are on page 1of 38

GENERATION OF SIGNALS

UNIT IMPULSE SIGNAL

clc; clear all; close all; t=-5:1:5; y=[zeros(1,5),ones(1,1),zeros(1,5)]; figure(1); subplot(2,2,1); stem (t,y); xlabel('time-->'); ylabel('amplitude-->'); title('unit impulse signal');

UNIT STEP SIGNAL

N=10; x=[zeros(1,5),ones(1,5)]; n=0:1:N-1; subplot(2,2,2); stem(n,x); xlabel('time-->'); ylabel('amplitude-->') title('unit step signal');

UNIT RAMP SIGNAL

n=6; t1=0:n; subplot(2,2,3); stem(t1,t1); xlabel('time-->'); ylabel('amplitude-->'); title('unit ramp signal');

UNIT EXPONENTIAL SIGNAL

n=.5; t=-5:1:5; y=exp(-n*-t); subplot(2,2,4); stem(t,y); xlabel('time-->'); ylabel('amplitude-->'); title('exponential');

UNIT SINE SIGNAL

f=100; t=1/f; t1=0:t:10; x=sin(2*pi*t1); figure(2); subplot(2,1,1); plot(t1,x); xlabel('time-->'); ylabel('amplitude-->'); title('sine signal'); UNIT COSINE SIGNAL

f=100; t=1/f; t1=0:t:10; y=cos(2*pi*t1); subplot(2,1,2); plot(t1,y); xlabel('time-->'); ylabel('amplitude-->'); title('cosine signal');

OUTPUT WAVEFORM
unit impulse signal 1
amplitude--> amplitude-->

unit step signal 1

0.5

0.5

0 -5

0 time--> unit ramp signal

5 time--> exponential

10

6
amplitude--> amplitude-->

15

10

2 time-->

0 -5

0 time-->

sine signal 1
amplitude-->

0.5 0 -0.5 -1

5 6 time--> cosine signal

10

1
amplitude-->

0.5 0 -0.5 -1

5 time-->

10

SAMPLING WAVEFORM clc; clear all; close all; N=input('Enter the number of samples N='); fm=input('Enter the frequency'); t=0:0.01:N; X=cos(2*pi*fm*t); subplot(3,2,1); plot(t,X); xlabel('Time'); ylabel('Amplitude'); title('Input signal'); fs1=fm; fs2=2*fm; fs3=5*fm; n=0:0.08:N; y=cos(2*pi*fm*n); subplot(3,2,2); stem(n,y,'r'); xlabel('Time'); ylabel('Amplitude'); title('sampling signal'); y1=cos(2*pi*n*fm/fs1); subplot(3,2,3); stem(n,y1,'g'); xlabel('Time'); ylabel('Amplitude'); title('sampling signal with fs<2fm'); y2=cos(2*pi*n*fm/fs2); subplot(3,2,4); stem(n,y2); xlabel('Time'); ylabel('Amplitude'); title('sampling signal with fs=2fm ');

y3=cos(2*pi*n*fm/fs3); subplot(3,2,5); stem(n,y3); xlabel('time'); ylabel('Amplitude'); title('sampling signal with fs>2fm');

OUTPUT WAVEFORM
Input signal
Amplitude Amplitude

sampling signal 1 0 -1 0 4 Time sampling signal with fs=2fm 2 6

1 0 -1 0 2 4 6

Time sampling signal with fs<2fm


Amplitude Amplitude

1 0 -1 0 2 4 6

1 0 -1 0 2 Time 4 6

Time sampling signal with fs>2fm


Amplitude

1 0 -1 0 2 time 4 6

Input signal
Amplitude Amplitude

sampling signal 1 0.5 0 0 4 Time sampling signal with fs=2fm 2 6

1 0 -1 0 2 4 6

Time sampling signal with fs<2fm


Amplitude Amplitude

1 0 -1 0 2 4 6

1 0 -1 0 2 Time 4 6

Time sampling signal with fs>2fm


Amplitude

1 0 -1 0 2 time 4 6

CALCULATION OF FFT clc; clear all; close all; x=input('x(n)='); N=length(x); n=input('n='); y=fft(x,n); v=0:1:N-1; t=0:1:n-1; subplot(2,2,1); stem(v,x); xlabel('Time'); ylabel('Amplitude'); title('Input signal'); subplot(2,2,2); stem(t,abs(y)); xlabel('Time'); ylabel('Amplitude'); title('Magnitude Response'); subplot(2,2,3); stem(t,angle(y)); xlabel('Time'); ylabel('Amplitude'); title('Phase response'); disp('fft x(n)=1'); disp(y); y1=ifft(y,n); subplot(2,2,4); stem(t,y1); xlabel('Time'); ylabel('Amplitude'); title('IFFT Response'); disp('ifft x(k)'); disp(y1);

OUTPUT WAVEFORM
Input signal 1 4 3 2 1 0 Magnitude Response

Amplitude

0.5

4 6 Time Phase response

Amplitude

4 6 Time IFFT Response

Amplitude

Amplitude
0 2 4 Time 6 8

0.5

-2

4 Time

LINEAR CONVOLUTION clc; clear all; close all; x=input('Enter the first sample'); N1=length(x); h=input('Enter the second sample'); N2=length(h); n=0:1:N1-1; subplot(2,2,1); stem(n,x); xlabel('Time'); ylabel('Amplitude'); title('X sequence response'); n=0:1:N2-1; subplot(2,2,2); stem(n,h); xlabel('Time'); ylabel('Amplitude'); title('H sequence response'); y=conv(x,h); N=N1+N2-1; n=0:1:N-1; subplot(2,2,3); stem(n,y); xlabel('Time'); ylabel('Amplitude'); title('Convolution of X and H response');

OUTPUT WAVEFORM
X sequence response 2 1.5 1 0.5 0 4 3 2 1 0 H sequence response

Amplitude

0.5 1 Time Convolution of X and H response

Amplitude

0.5

1 Time

1.5

8 6 4 2 0

Amplitude

1 Time

CIRCULAR CONVOLUTION clc; clear all; close all; x=input('Enter the first sampels'); N1=length(x); h=input('Enter the second samples'); N2=length(h); n=0:1:N1-1; subplot(2,2,1); stem(n,x); xlabel('Time'); ylabel('Amplitude'); title('X sequence response'); n=0:1:N2-1; subplot(2,2,2); stem(n,h); xlabel('Time'); ylabel('Amplitude'); title('H sequence response'); N=max(N1,N2); x=[x,zeros(1,N-N1)]; h=[h,zeros(1,N-N2)]; for n=1:N y(n)=0; for i=1:N j=n-i+1; if(j<=0) j=N+j; end y(n)=y(n)+x(i)*h(j); end end disp('Convolution of x & h is'); disp(y); subplot(2,2,3); stem(y); xlabel('Time'); ylabel('amplitude'); title('Convolution of X & H Response');

OUTPUT WAVEFORM
X sequence response 4 3 2 1 0 2 1.5 1 0.5 0 H sequence response

Amplitude

1 1.5 2 Time Convolution of X & H Response

0.5

Amplitude

0.5 Time

10

amplitude

1.5

2 Time

2.5

FIR FILTER USING RECTANGULAR WINDOW clc; clear all; close all; rp=input('pass band ripple='); rs=input('stop band ripple='); fs=input('stop band frequency in rad/sec='); fp=input('pass band frequency in rad/sec='); f=input('sampling frequency in rad/sec='); wp=2*fp/f; ws=2*fs/f; num=-20*log10(sqrt(rp*rs))-13; dem=14.6*(fs-fp)/f; n=ceil(num/dem); n1=n+1; if(rem(n,2)~=0); n1=n; n=n-1; end y=boxcar(n1); %LOW PASS FILTER b=fir1(n,wp,y); [h,o]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,1); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency-->'); title('Low pass filter'); %High pass filter b=fir1(n,wp,'high',y); [h,o]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,2); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency-->'); title('HIGH PASS FILTER'); %BAND PASS FILTER wn=[wp,ws]; x=fir1(n,wn,y); [h,o]=freqz(b,1,256); subplot(2,2,3); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency');

title('Band pass filter'); %BAND STOP FILTER b=fir1(n,wn,'stop',y); [h,o]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,4); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency--->'); title('Band stop filter');

OUTPUT WAVEFORM
Low pass filter 50
Gain in db--> Gain in db-->

HIGH PASS FILTER 50

-50

-50

-100

0.5 Normalised frequency--> Band pass filter

-100

0.5 Normalised frequency--> Band stop filter

50
Gain in db--> Gain in db-->

10

-50

-10

-100

0.5 Normalised frequency

-20

0.5 Normalised frequency--->

HAMMING WINDOW clc; clear all; close all; rp=input('pass band ripple='); rs=input('stop band ripple='); fs=input('stop band frequency in rad/sec='); fp=input('pass band frequency in rad/sec='); f=input('sampling frequency in rad/sec='); wp=2*fp/f; ws=2*fs/f; num=-20*log10(sqrt(rp*rs))-13; dem=14.6*(fs-fp)/f; n=ceil(num/dem); n1=n+1; if(rem(n,2)~=0); n1=n; n=n-1; end y=hamming(n1); %LOW PASS FILTER b=fir1(n,wp,y); [h,o]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,1); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency-->'); title('Low pass filter'); %High pass filter b=fir1(n,wp,'high',y); [h,o]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,2); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency-->'); title('HIGH PASS FILTER'); %BAND PASS FILTER wn=[wp,ws]; x=fir1(n,wn,y); [h,o]=freqz(b,1,256); subplot(2,2,3); plot(o/pi,m,'k'); ylabel('Gain in db-->');

xlabel('Normalised frequency'); title('Band pass filter'); %BAND STOP FILTER b=fir1(n,wn,'stop',y); [h,o]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,4); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency--->'); title('Band stop filter');

OUTPUT WAVEFORM
Low pass filter 0
Gain in db--> Gain in db-->

HIGH PASS FILTER 50

-50

-50

-100

0.5 Normalised frequency--> Band pass filter

-100

0.5 Normalised frequency--> Band stop filter

50
Gain in db--> Gain in db-->

0 -2 -4 -6 -8

-50

-100

0.5 Normalised frequency

0.5 Normalised frequency--->

HANNING WINDOW clc; clear all; close all; rp=input('pass band ripple='); rs=input('stop band ripple='); fs=input('stop band frequency in rad/sec='); fp=input('pass band frequency in rad/sec='); f=input('sampling frequency in rad/sec='); wp=2*fp/f; ws=2*fs/f; num=-20*log10(sqrt(rp*rs))-13; dem=14.6*(fs-fp)/f; n=ceil(num/dem); n1=n+1; if(rem(n,2)~=0); n1=n; n=n-1; end y=hanning(n1); %LOW PASS FILTER b=fir1(n,wp,y); [h,o]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,1); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency-->'); title('Low pass filter'); %High pass filter b=fir1(n,wp,'high',y); [h,o]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,2); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency-->'); title('HIGH PASS FILTER'); %BAND PASS FILTER wn=[wp,ws]; x=fir1(n,wn,y); [h,o]=freqz(b,1,256); subplot(2,2,3); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency');

title('Band pass filter'); %BAND STOP FILTER b=fir1(n,wn,'stop',y); [h,o]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,4); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency--->'); title('Band stop filter');

OUTPUT WAVEFORM
Low pass filter 50
Gain in db--> Gain in db-->

HIGH PASS FILTER 50

0 -50 -100 -150

-50

0.5 Normalised frequency--> Band pass filter

-100

0.5 Normalised frequency--> Band stop filter

50
Gain in db--> Gain in db-->

-50

-5

-100

0.5 Normalised frequency

-10

0.5 Normalised frequency--->

BLACKMAN WINDOW clc; clear all; close all; rp=input('pass band ripple='); rs=input('stop band ripple='); fs=input('stop band frequency in rad/sec='); fp=input('pass band frequency in rad/sec='); f=input('sampling frequency in rad/sec='); wp=2*fp/f; ws=2*fs/f; num=-20*log10(sqrt(rp*rs))-13; dem=14.6*(fs-fp)/f; n=ceil(num/dem); n1=n+1; if(rem(n,2)~=0); n1=n; n=n-1; end y=blackman(n1); %LOW PASS FILTER b=fir1(n,wp,y); [h,o]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,1); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency-->'); title('Low pass filter'); %High pass filter b=fir1(n,wp,'high',y); [h,o]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,2); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency-->'); title('HIGH PASS FILTER'); %BAND PASS FILTER wn=[wp,ws]; x=fir1(n,wn,y); [h,o]=freqz(b,1,256); subplot(2,2,3); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency');

title('Band pass filter'); %BAND STOP FILTER b=fir1(n,wn,'stop',y); [h,o]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,4); plot(o/pi,m,'k'); ylabel('Gain in db-->'); xlabel('Normalised frequency--->'); title('Band stop filter');

OUTPUT WAVEFORM
Low pass filter 0
Gain in db--> Gain in db-->

HIGH PASS FILTER 50

-50

-100

-50

-150

0.5 Normalised frequency--> Band pass filter

-100

0.5 Normalised frequency--> Band stop filter

50
Gain in db--> Gain in db-->

2 0 -2 -4 -6

-50

-100

0.5 Normalised frequency

0.5 Normalised frequency--->

BUTTERWORTH IIR FILTER


clc; clear all; close all; N=8; wn=0.4; [num,den]=butter(N,wn,'s'); w=(0:0.01:2); h=freqs(num,den,w); subplot(2,2,1); plot(w/2*pi,(abs(h)),'linewidth',2.5); title('butterworth low pass filter'); grid on; xlabel('frequency in hz'); ylabel('gain in db'); N=8; wn=0.4; [num,den]=butter(N,wn,'high','s'); h=freqs(num,den,w); subplot(2,2,2); plot(w/2*pi,(abs(h)),'linewidth',2.5); title('butterworth high pass filter'); grid on; xlabel('frequency in hz'); ylabel('gain in db'); N=8; wp=0.4; ws=0.6; wn=[wp ws]; [num,den]=butter(N,wn,'s'); h=freqs(num,den,w); subplot(2,2,3); plot(w/2*pi,(abs(h)),'linewidth',2.5); title('butterworth band pass filter'); grid on; xlabel('frequency in hz'); ylabel('gain in db'); N=8; wp=0.4; ws=0.6; wn=[wp ws]; [num,den]=butter(N,wn,'stop','s'); h=freqs(num,den,w); subplot(2,2,4); plot(w/2*pi,(abs(h)),'linewidth',2.5); title('butterworth band stop filter'); grid on; xlabel('frequency in hz'); ylabel('gain in db');

OUTPUT WAVEFORM
butterworth low pass filter 1 1 butterworth high pass filter

gain in db

0.5

gain in db

0.5

1 2 3 4 frequency in hz butterworth band pass filter

1 2 3 frequency in hz butterworth band stop filter

1.5

1.5

gain in db

gain in db

0.5

0.5

1 2 3 frequency in hz

1 2 3 frequency in hz

DECIMATION ON POLYPHASE DECOMPOSITION clc; clear all; close all; x=input('enter the input sequences'); h=input('enter the fir coefficients='); M=input('enter the decimation factor='); N1=length(x); n=0:1:N1-1; subplot(2,1,1); stem(n,x); xlabel('time'); ylabel('amplitude'); title('x sequence response'); N2=length(h); n=0:1:N2-1; subplot(2,1,2); stem(n,h); xlabel('time'); ylabel('amplitude'); title('H sequence response'); H=length(h); p=floor((H-1)/M)+1; r=reshape([reshape(h,1,H),zeros(1,p*M-H)],M,p); X=length(x); y=floor((x+H-2)/M)+1; U=floor((x+M-2)/M)+1; R=zeros(1,x+p-1); for m=1:M R=R+conv(x(1,:),r(m,:)); end disp(R); N=length(R); n=0:1:N-1; figure(2); stem(n,R); xlabel('time'); ylabel('amplitude'); title('decimation of polyphase decomposition sequence response');

OUTPUT WAVEFORM
x sequence response 3

amplitude

0.2

0.4

0.6

1 1.2 time H sequence response

0.8

1.4

1.6

1.8

amplitude

0.2

0.4

0.6

0.8

1 time

1.2

1.4

1.6

1.8

decimation of polyphase decomposition sequence response 15

10

amplitude
5 0 0

0.5

1.5 time

2.5

DIRECT ADDITION .MMREGS .TEXT START: LDP #100H LACC #0007H,0 SACL 0000,0 LT 0000 add #0005H SACL 0002 SACH 0003 hlt: b hlt

DIRECT SUBTRACTION .MMREGS .TEXT start: LDP #100H LACC #0005H,0 SACL 0000,0 LT 0000 SUB #0005H SACL 0002 SACH 0003 hlt: b hlt

INDIRECT ADDITION .MMREGS .TEXT start: ldp #100h nop nop lacc 0h add 1h sacl 2h sach 3h hlt: b hlt

INDIRECT SUBTRACTION .MMREGS .TEXT start: ldp #100h nop nop lacc 0h sub1h sacl 2h sach 3h hlt: b hlt

LINEAR CONVOLUTION .mmregs .text START: LDP #02H LAR AR1,#8100H lar ar0,#08200H LAR AR3,#8300H LAR AR4,#0006 Lar ar0,#8203H lacc #0c100h mar *,ar0 rpt #3 tblw *lar ar6,#8104h mar *,ar6 lacc #0h rpt #2h sacl *+ LOP: MAR *,AR1 LACC *+ SACL 050H LAR AR2,#0153H MAR *,AR2 ZAP RPT #03H MACD 0C100H,*APAC MAR *,AR3 SACL *+ MAR *,AR4 BANZ LOP,*H: B H

CIRCULAR CONVOLUTION .mmregs .text START: LDP #100H LAR AR2,#8200H LAR AR1,#8400H LAR AR4,#8300H LAR AR3,#03H MAR *,AR2 LACC *,AR1 SACL *+,AR2 LAR AR2,#(8200h+3h) LAR AR0,#2H LACC *-,AR1 SACL *+,AR0 BANZ Re_arange,*-,AR2 Next_YN: LAR AR1,#8100H LAR AR2,#8400H LAR AR0,#3H ZAC SACL 0H MAR *,AR1 LT *+,AR2 Loop_MAC: MPY *+,AR1 LTP *+,AR0 ADD 0H SACL 0H BANZ Loop_MAC,*-,AR2 LACC 0H MAR *,AR4 SACL *+ LAR AR1,#(8400h+3h) LAR AR2,#2H LAR AR0,#2H MAR *,AR1 LACC *SACL 1H Shift_X2N: LACC *+ SACL *0-,AR2 BANZ Shift_X2N,*-,AR1 MAR *+ LACC 1H SACL *,AR3 BANZ Next_YN,*NOP H: B H

SAMPLING OF SIGNALS .MMREGS .TEXT START: LDP #0100H NOP ADC_Start: N 0,06H NOP NOP NOP N 0,04H LPT #0FH NOP LACC 0H AND #0FFFH LACL 0H OUT 0,04H B ADC_Start NOP NOP END

TRIANGLE WAVE FORM


AMPLITUDE .SET 4 FREQ .SET 350 TEMP .SET 0 .mmregs .text START: LDP #100H splk #0,TEMP CONT1: lar AR2,#FREQ CONT: out TEMP,4 LACC TEMP ADD #AMPLITUDE SACL TEMP MAR *,AR2 BANZ CONT,*LAR AR2,#FREQ CONTx: OUT TEMP,4 LACC TEMP SUB #AMPLITUDE SACL TEMP MAR *,AR2 BANZ CONTx B CONT1 .end SQUARE WAVE FORM .mmregs .text start: ldp #100h lacc #0fffh loop: sacl 0 rpt #0ffh out 0,04 cmpl b loop .end SAWTOOTH WAVEFORM GENERRATION .MMREGS .TEXT START: LDP #120H LACC #0H SACL 0 LOOP: LACC 0 OUT 0,04H ADD #05h SACL 0 SUB #0FFFh BCND LOOP,LEQ B START .END

SINE WAVE FORM INCFREQ .set 10 DECFREQ .set 0 LENGTH .set 360 AMPLITUDE .set 5 delay .set 7 TEMP .set 0 TEMP1 .set 1 .mmregs .text START: LDP #100H SPLK #TABLE,TEMP lar AR2,#( (LENGTH/INCFREQ)+(LENGTH*DECFREQ) )-1 lar ar3,#DECFREQ CONT: CALL DELAY LACC TEMP TBLR TEMP1 LT TEMP1 MPY #AMPLITUDE PAC SACL TEMP1 mar *,ar3 banz repeat,*lar ar3,#DECFREQ LACC TEMP ADD #INCFREQ SACL TEMP OUT TEMP1,4 MAR *,AR2 BANZ CONT,*b START DELAY: lar ar7,#delay mar *,ar7 back: banz back,*ret ;

TABLE .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word

100 101 103 105 106 108 110 112 113 115 117 119 120 122 124 125 127 129 130 132 134 135 137 139 140 142 143 145 146 148 150 151 152 154 155 157 158 160 161 162 164 165 166 168 169 170 171 173 174 175

.word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word

176 177 178 179 180 181 182 183 184 185 186 187 188 189 189 190 191 192 192 193 193 194 195 195 196 196

.word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word

197 197 197 198 198 198 199 199 199 199 199 199 199 199 200 199 199 199 199 199 199 199 199 198 198 198

.word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word

197 197 197 196 196 195 195 194 193 193 192 192 191 190 189 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 171 170 169 168 166 165 164 162 161 160 158 157 155 154 152 151 149 148 146 145

.word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word

143 142 140 139 137 135 134 132 130 129 127 125 124 122 120 119 117 115 113 112 110 108 106 105 103 101 99 98 96 94 93 91 89 87 86 84 82 80 79 77 75 74 72 70 69 67 65 64 62 60 59 57

.word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word

56 54 53 51 49 48 47 45 44 42 41 39 38 37 35 34 33 31 30 29 28 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 10 9 8 7 7 6 6 5 4 4 3 3 2 2

.word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word

2 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 2 2 2 3 3 4 4 5 6 6 7

.word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word

7 8 9 10 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 28 29 30 31 33 34 35 37 38 39 41 42 44 45

.word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .end

47 48 50 51 53 54 56 57 59 60 62 64 65 67 69 70 72 74 75 77 79 80 82 84 86 87 89 91 93 94 96 98 100

FIR-LOW PASS FILTER .mmregs .text B START CTABLE: .word 0FFE7H .word 0FFD3H .word 0FFC6H .word 0FFC4H .word 0FFD0H .word 0FFECH .word 018H .word 051H .word 08CH .word 0B9H .word 0C2H .word 092H .word 01AH .word 0FF5FH .word 0FE78H .word 0FD9AH .word 0FD10H .word 0FD30H .word 0FE42H .word 071H .word 03B5H .word 07CAH .word 0C34H .word 01054H .word 01387H .word 01547H .word 01547H .word 01387H .word 01054H .word 0C34H .word 07CAH .word 03B5H .word 071H .word 0FE42H .word 0FD30H .word 0FD10H .word 0FD9AH .word 0FE78H .word 0FF5FH .word 01AH .word 092H .word 0C2H .word 0B9H .word 08CH .word 051H .word 018H .word 0FFECH .word 0FFD0H .word 0FFC4H

.word 0FFC6H .word 0FFD3H .word 0FFE7H START: LAR AR0,#0200H MAR *,AR0 RPT #33H BLKP CTABLE,*+ SETC CNF ISR: LDP #0AH LACC #0H SACL 0H IN 0,06H IN 0,4 NOP NOP LAR AR1,#0300H MAR *,AR1 LACC 0H AND #0FFFH SUB #800H SACL * LAR AR1,#333H MPY #0 ZAC RPT #33H MACD 0FF00H,*APAC LAR AR1,#0300H SACH * LACC * ADD #800h SACL * OUT *,4 NOP B ISR .end

FIR-HIGH PASS FILTER .mmregs .text B START CTABLE .word 0FCD3H .word 05H .word 0FCB9H .word 087H .word 0FD3FH .word 01ADH .word 0FE3DH .word 0333H .word 0FF52H .word 04ABH .word 0FFF8H .word 0595H .word 0FFACH .word 0590H .word 0FE11H .word 047CH .word 0FB0BH .word 029DH .word 0F6BAH .word 0AEH .word 0F147H .word 01CH .word 0E9FDH .word 04C5H .word 0D882H .word 044BCH .word 044BCH .word 0D882H .word 04C5H .word 0E9FDH .word 01CH .word 0F147H .word 0AEH .word 0F6BAH .word 029DH .word 0FB0BH .word 047CH .word 0FE11H .word 0590H .word 0FFACH .word 0595H .word 0FFF8H .word 04ABH .word 0FF52H .word 0333H .word 0FE3DH .word 01ADH .word 0FD3FH

.word .word .word .word

087H 0FCB9H 05H 0FCD3H

START: LAR AR0,#0200H MAR *,AR0 RPT #33H BLKP CTABLE,*+ SETC CNF ISR: LDP #0AH LACC #0 SACL 0 IN 0,06H NOP IN 0,4 NOP NOP NOP NOP LAR AR1,#0300H MAR *,AR1 LACC 0H AND #0FFFH SUB #800H SACL * LAR AR1,#333H MPY #0 ZAC RPT #33H MACD 0FF00H,*APAC LAR AR1,#0300H SACH * LACC * ADD #800H SACL * OUT *,4 NOP B ISR .end

You might also like