You are on page 1of 41

langkah 1

%fc=30*240/2*225;
%f_LPF1=30*240/2*150;
%f_LPF2=0.2E6;

filename=mobilcal58.yuv %input('please input file name:','s');
fc=8.1E5;%input('Please Input fc: ');
f_LPF1=5.4E5;%input('Please Input f_LPF1: ');
f_LPF2=2E5;%input('Please Input f_LPF2: ');
[Rframe,Gframe,Bframe,Yframe,Iframe,Qframe]=YCbCr2RGB2YIQ(filename,480,704,1)
;
displayRGB(Rframe,Gframe,Bframe);
title('Original color frame');

Y component

figure 1

Cb component

figure 2

Cr component

Y component

I component

Q component

Original color frame

[Yraster,Iraster,Qraster]=frame2raster(Yframe,Iframe,Qframe);
Fs=30*352*240; %sampling rate
%compute and plot the spectrum
[YP,IP,QP,F]=displayRasterSpectrum(Yraster,Iraster,Qraster,Fs);

fprintf('Dispaly the 1-D raster signals and their spectrum.......\nPress any
key to continue..\n');
pause;
close all;

Y Waveform I Waveform Q Waveform 250 100 100 200 50 50 150 Gray Level Gray Level Gray Level 0 0 100 -50 -50 50 -100 -100 0 0 5 0 5 0 5 Time -4 Time -4 Time -4 x 10 x 10 x 10 6 Y Spectrum 6 I Spectrum 6 Q Spectrum 10 10 10 5 5 5 10 10 10 4 4 4 10 10 10 3 3 3 10 10 10 2 2 2 10 10 10 1 1 1 10 10 10 0 0 0 10 10 10 -1 -1 -1 10 10 10 0 5 10 0 5 10 0 5 10 5 5 5 x 10 x 10 x 10 .

Yraster.\nPress any key to continue.F.. pause..Iraster.\n')... displayMultiplexAll(composite_video...QP ) fprintf('QAM Modulation.Qraster. close all.Fs. I Waveform Q Waveform QAM multiplexed I & Q 80 80 80 60 60 60 40 40 40 20 20 20 Gray Level Gray Level Gray Level 0 0 0 -20 -20 -20 -40 -40 -40 -60 -60 -60 -80 -80 -80 0 1 0 1 0 1 Time -4 Time -4 Time -4 x 10 x 10 x 10 .QAM]=YIQmultiplexing(Yraster.[composite_video.IP.Qraster.QAM.Iraster..YP.fc)..

5 0 0.5 1 1.5 Time -4 Time -4 x 10 x 10 .5 1 1. 6 I Spectrum 6 Q Spectrum 6 QAM I+Q Spectrum 10 10 10 5 5 5 10 10 10 4 4 4 10 10 10 3 3 3 10 10 10 2 2 2 10 10 10 1 1 1 10 10 10 0 0 0 10 10 10 -1 -1 -1 10 10 10 0 5 10 0 5 10 0 5 10 5 5 5 x 10 x 10 x 10 Y Waveform Composite Waveform 300 300 250 250 200 200 Gray Level Gray Level 150 150 100 100 50 50 0 0 -50 0 0.

6 Y Spectrum 6 Composite Video Spectrum 10 10 5 5 10 10 4 4 10 10 3 3 10 10 2 2 10 10 0 5 10 0 5 10 5 5 x 10 x 10 Composite Spectrum (beginning) Composite Spectrum (near fc ) 6 6 10 10 5 5 10 10 4 4 10 10 3 3 10 10 2 2 10 10 0 5 10 15 7.5 8 8.5 9 4 5 x 10 x 10 .

%f_LPF2=0.'s'). fc=0.54%input('Please Input f_LPF1: '). %f_LPF1=30*240/2*150. . filename=input('Please Input File Name: '.2E6.81%input('Please Input fc: '). Image seen by B/W TV without filtering Langkah 3 %fc=30*240/2*225. f_LPF1=0.

.f_LPF2=0..Bframe... title('Original color frame').. fprintf('Dispaly the current frame.\nPress any key to continue.Qframe]=YCbCr2RGB2YIQ(filename.1) .. pause.704.Yframe.Gframe. [Rframe. close all.Bframe). displayRGB(Rframe.2%input('Please Input f_LPF2: ').480.Iframe.\n').Gframe... Y component Cb component .

Cr component Y component I component .

Qraster.\nPress any key to continue.. Fs=30*352*240.. Q component Original color frame [Yraster. ..Qframe).Iraster.Iframe.Qraster]=frame2raster(Yframe..Iraster. fprintf('Dispaly the 1-D raster signals and their spectrum...IP. close all.\n').Fs). pause. %sampling rate %compute and plot the spectrum [YP.QP..F]=displayRasterSpectrum(Yraster.

Y Waveform I Waveform Q Waveform 250 100 100 200 50 50 150 Gray Level Gray Level Gray Level 0 0 100 -50 -50 50 -100 -100 0 0 5 0 5 0 5 Time -4 Time -4 Time -4 x 10 x 10 x 10 6 Y Spectrum 6 I Spectrum 6 Q Spectrum 10 10 10 5 5 5 10 10 10 4 4 4 10 10 10 3 3 3 10 10 10 2 2 2 10 10 10 1 1 1 10 10 10 0 0 0 10 10 10 -1 -1 -1 10 10 10 0 5 10 0 5 10 0 5 10 5 5 5 x 10 x 10 x 10 .

\nPress any key to continue. close all.Qraster.QP ) fprintf('QAM Modulation.YP.. displayMultiplexAll(composite_video..Iraster.Iraster.... pause.\n')..Fs..fc).[composite_video..IP.Yraster.F.Qraster.QAM]=YIQmultiplexing(Yraster. I Waveform Q Waveform QAM multiplexed I & Q 80 80 80 60 60 60 40 40 40 20 20 20 Gray Level Gray Level Gray Level 0 0 0 -20 -20 -20 -40 -40 -40 -60 -60 -60 -80 -80 -80 0 1 0 1 0 1 Time -4 Time -4 Time -4 x 10 x 10 x 10 .QAM.

5 Time -4 Time -4 x 10 x 10 . 6 I Spectrum 6 Q Spectrum 6 QAM I+Q Spectrum 10 10 10 5 5 5 10 10 10 4 4 4 10 10 10 3 3 3 10 10 10 2 2 2 10 10 10 1 1 1 10 10 10 0 0 0 10 10 10 -1 -1 -1 10 10 10 0 5 10 0 5 10 0 5 10 5 5 5 x 10 x 10 x 10 Y Waveform Composite Waveform 250 250 200 200 150 150 Gray Level Gray Level 100 100 50 50 0 0 -50 -50 0 0.5 1 1.5 1 1.5 0 0.

5 8 8.5 9 4 5 x 10 x 10 . 6 Y Spectrum 6 Composite Video Spectrum 10 10 5 5 10 10 4 4 10 10 3 3 10 10 2 2 10 10 0 5 10 0 5 10 5 5 x 10 x 10 Composite Spectrum (beginning) Composite Spectrum (near fc ) 6 6 10 10 5 5 10 10 4 4 10 10 3 3 10 10 2 2 10 10 0 5 10 15 7.

f_LPF1=0.Bframe.704.2E6. [Rframe.'s'). %f_LPF2=0.Gframe. Image seen by B/W TV without filtering Langkah 4 %fc=30*240/2*225.1) . fc=0.Iframe.Qframe]=YCbCr2RGB2YIQ(filename.Gframe. filename=input('Please Input File Name: '.Bframe).44%input('Please Input f_LPF1: '). f_LPF2=0. title('Original color frame').2%input('Please Input f_LPF2: '). .81%input('Please Input fc: ').480. %f_LPF1=30*240/2*150. displayRGB(Rframe.Yframe.

close all.. Y component Cb component ....\nPress any key to continue...\n')..fprintf('Dispaly the current frame.. pause.

Cr component Y component I component .

Fs=30*352*240..Fs).. close all. pause.F]=displayRasterSpectrum(Yraster.Qraster]=frame2raster(Yframe.\n')..Qframe).Qraster... fprintf('Dispaly the 1-D raster signals and their spectrum. %sampling rate %compute and plot the spectrum [YP. .Iraster.QP.. Q component Original color frame [Yraster.IP.Iframe.\nPress any key to continue.Iraster..

Y Waveform I Waveform Q Waveform 250 100 100 200 50 50 150 Gray Level Gray Level Gray Level 0 0 100 -50 -50 50 -100 -100 0 0 5 0 5 0 5 Time -4 Time -4 Time -4 x 10 x 10 x 10 6 Y Spectrum 6 I Spectrum 6 Q Spectrum 10 10 10 5 5 5 10 10 10 4 4 4 10 10 10 3 3 3 10 10 10 2 2 2 10 10 10 1 1 1 10 10 10 0 0 0 10 10 10 -1 -1 -1 10 10 10 0 5 10 0 5 10 0 5 10 5 5 5 x 10 x 10 x 10 [composite_video.QAM]=YIQmultiplexing(Yraster.fc). .Qraster.Iraster.

IP.. close all.YP...\n').Fs. pause.Iraster..Yraster.QAM.F. I Waveform Q Waveform QAM multiplexed I & Q 80 80 80 60 60 60 40 40 40 20 20 20 Gray Level Gray Level Gray Level 0 0 0 -20 -20 -20 -40 -40 -40 -60 -60 -60 -80 -80 -80 0 1 0 1 0 1 Time -4 Time -4 Time -4 x 10 x 10 x 10 ...\nPress any key to continue.QP ) fprintf('QAM Modulation...Qraster.displayMultiplexAll(composite_video.

5 0 0. 6 I Spectrum 6 Q Spectrum 6 QAM I+Q Spectrum 10 10 10 5 5 5 10 10 10 4 4 4 10 10 10 3 3 3 10 10 10 2 2 2 10 10 10 1 1 1 10 10 10 0 0 0 10 10 10 -1 -1 -1 10 10 10 0 5 10 0 5 10 0 5 10 5 5 5 x 10 x 10 x 10 Y Waveform Composite Waveform 300 300 250 250 200 200 Gray Level Gray Level 150 150 100 100 50 50 0 0 -50 0 0.5 1 1.5 Time -4 Time -4 x 10 x 10 .5 1 1.

6 Y Spectrum 6 Composite Video Spectrum 10 10 5 5 10 10 4 4 10 10 3 3 10 10 2 2 10 10 0 5 10 0 5 10 5 5 x 10 x 10 Composite Spectrum (beginning) Composite Spectrum (near fc ) 6 6 10 10 5 5 10 10 4 4 10 10 3 3 10 10 2 2 10 10 0 5 10 15 7.5 9 4 5 x 10 x 10 .5 8 8.

74%input('Please Input f_LPF1: ').. f_LPF1=0.Gframe.'s').\n'). fc=0...Gframe. f_LPF2=0.81%input('Please Input fc: '). fprintf('Dispaly the current frame. %f_LPF2=0.480. filename=input('Please Input File Name: '.\nPress any key to continue....1) .. pause. . displayRGB(Rframe.Iframe. %f_LPF1=30*240/2*150.704.Yframe.2%input('Please Input f_LPF2: '). Image seen by B/W TV without filtering Langkah 5 %fc=30*240/2*225.Bframe). title('Original color frame'). [Rframe.2E6.Qframe]=YCbCr2RGB2YIQ(filename.Bframe..

Y component Cb component Cr component .close all.

Y component I component Q component .

..Iraster.\nPress any key to continue.Fs). fprintf('Dispaly the 1-D raster signals and their spectrum. close all.Qraster]=frame2raster(Yframe.... .Iframe. Original color frame [Yraster.Iraster.F]=displayRasterSpectrum(Yraster. pause.QP. Fs=30*352*240.Qraster...\n'). %sampling rate %compute and plot the spectrum [YP.Qframe).IP.

Y Waveform I Waveform Q Waveform 250 100 100 200 50 50 150 Gray Level Gray Level Gray Level 0 0 100 -50 -50 50 -100 -100 0 0 5 0 5 0 5 Time -4 Time -4 Time -4 x 10 x 10 x 10 6 Y Spectrum 6 I Spectrum 6 Q Spectrum 10 10 10 5 5 5 10 10 10 4 4 4 10 10 10 3 3 3 10 10 10 2 2 2 10 10 10 1 1 1 10 10 10 0 0 0 10 10 10 -1 -1 -1 10 10 10 0 5 10 0 5 10 0 5 10 5 5 5 x 10 x 10 x 10 .

.Qraster.\nPress any key to continue.\n'). close all.Yraster. displayMultiplexAll(composite_video.IP.Qraster.Iraster.QAM]=YIQmultiplexing(Yraster.....QAM.. I Waveform Q Waveform QAM multiplexed I & Q 80 80 80 60 60 60 40 40 40 20 20 20 Gray Level Gray Level Gray Level 0 0 0 -20 -20 -20 -40 -40 -40 -60 -60 -60 -80 -80 -80 0 1 0 1 0 1 Time -4 Time -4 Time -4 x 10 x 10 x 10 .F.[composite_video.Iraster.QP ) fprintf('QAM Modulation..fc).. pause.YP.Fs.

5 1 1.5 0 0.5 1 1.5 Time -4 Time -4 x 10 x 10 . 6 I Spectrum 6 Q Spectrum 6 QAM I+Q Spectrum 10 10 10 5 5 5 10 10 10 4 4 4 10 10 10 3 3 3 10 10 10 2 2 2 10 10 10 1 1 1 10 10 10 0 0 0 10 10 10 -1 -1 -1 10 10 10 0 5 10 0 5 10 0 5 10 5 5 5 x 10 x 10 x 10 Y Waveform Composite Waveform 300 300 250 250 200 200 Gray Level Gray Level 150 150 100 100 50 50 0 0 -50 0 0.

5 9 4 5 x 10 x 10 . 6 Y Spectrum 6 Composite Video Spectrum 10 10 5 5 10 10 4 4 10 10 3 3 10 10 2 2 10 10 0 5 10 0 5 10 5 5 x 10 x 10 Composite Spectrum (beginning) Composite Spectrum (near fc ) 6 6 10 10 5 5 10 10 4 4 10 10 3 3 10 10 2 2 10 10 0 5 10 15 7.5 8 8.

f_LPF2=0.54%input('Please Input f_LPF1: ').'s'). fc=0. %f_LPF1=30*240/2*150. Image seen by B/W TV without filtering Langkah 6 %fc=30*240/2*225. %f_LPF2=0. filename=input('Please Input File Name: '. f_LPF1=0.70%input('Please Input fc: ').2%input('Please Input f_LPF2: '). .2E6.

. displayRGB(Rframe..\n').704.Iframe.Bframe).. pause.\nPress any key to continue.Bframe. close all..Gframe.Yframe.. title('Original color frame').Gframe.1) . fprintf('Dispaly the current frame. Y component Cb component .[Rframe.Qframe]=YCbCr2RGB2YIQ(filename....480.

Cr component Y component I component .

\nPress any key to continue..Iraster..QP.Iraster.Fs).Qframe).\n'). %sampling rate %compute and plot the spectrum [YP.F]=displayRasterSpectrum(Yraster.Iframe. pause. fprintf('Dispaly the 1-D raster signals and their spectrum.IP. Q component Original color frame [Yraster... close all.. .Qraster...Qraster]=frame2raster(Yframe. Fs=30*352*240.

Y Waveform I Waveform Q Waveform 250 100 100 200 50 50 150 Gray Level Gray Level Gray Level 0 0 100 -50 -50 50 -100 -100 0 0 5 0 5 0 5 Time -4 Time -4 Time -4 x 10 x 10 x 10 6 Y Spectrum 6 I Spectrum 6 Q Spectrum 10 10 10 5 5 5 10 10 10 4 4 4 10 10 10 3 3 3 10 10 10 2 2 2 10 10 10 1 1 1 10 10 10 0 0 0 10 10 10 -1 -1 -1 10 10 10 0 5 10 0 5 10 0 5 10 5 5 5 x 10 x 10 x 10 .

Qraster. close all.Iraster.IP..QAM]=YIQmultiplexing(Yraster.Fs..[composite_video.Yraster.Iraster..QAM.QP ) fprintf('QAM Modulation. displayMultiplexAll(composite_video.fc)..\nPress any key to continue.YP..Qraster. pause.. I Waveform Q Waveform QAM multiplexed I & Q 80 80 80 60 60 60 40 40 40 20 20 20 Gray Level Gray Level Gray Level 0 0 0 -20 -20 -20 -40 -40 -40 -60 -60 -60 -80 -80 -80 0 1 0 1 0 1 Time -4 Time -4 Time -4 x 10 x 10 x 10 .\n')...F.

5 1 1.5 1 1. 6 I Spectrum 6 Q Spectrum 6 QAM I+Q Spectrum 10 10 10 5 5 5 10 10 10 4 4 4 10 10 10 3 3 3 10 10 10 2 2 2 10 10 10 1 1 1 10 10 10 0 0 0 10 10 10 -1 -1 -1 10 10 10 0 5 10 0 5 10 0 5 10 5 5 5 x 10 x 10 x 10 Y Waveform Composite Waveform 300 300 250 250 200 200 Gray Level Gray Level 150 150 100 100 50 50 0 0 -50 0 0.5 0 0.5 Time -4 Time -4 x 10 x 10 .

6 Y Spectrum 6 Composite Video Spectrum 10 10 5 5 10 10 4 4 10 10 3 3 10 10 2 2 10 10 0 5 10 0 5 10 5 5 x 10 x 10 Composite Spectrum (beginning) Composite Spectrum (near fc ) 6 6 10 10 5 5 10 10 4 4 10 10 3 3 10 10 2 2 10 10 0 5 10 15 7.5 9 4 5 x 10 x 10 .5 8 8.

Image seen by B/W TV without filtering .