pcm

21
DIAN KARTIKA SARI [7211040011] 2 D4 TELKOM A SOURCE CODE PROGRAM function varargout = PCM(varargin) % PCM M-file for PCM.fig % PCM was designed in order to show how PCM works % % To simplify the undesrtanding of this method, the program first takes % a sine wave. Then you can choose a sampling scheme, and you can see % the output of the sampler. You can choose one out of three sampling % methods. % If you choose natural sampling; then you will have the chance to modify % the sampling window, and see the effects of this change in the output of % the sampler. % % Once you got the sampled signal you can quantize it by a method that is % known as two rules and an alorithm. % The option Squeezing and Stretching shows the best G(x) tha minimizes % the MSE. You can better understand this using the book % Telecommunications Demystified written by Carl Nassar. You can find % information about this on Chapter four of that book. % You can edit the bit's number and the number of iterations of the % algorithm. The bigger the number of bits, the smaller the MSE. % The picture shows the signal after quantization, the first iteration % in the quantization process and the output of the quantizer % % Then, by pressing the Bit Stream button you will see the PCM output % of the signal that you have selected in the input area. % % Everytime you change something, you must push the button that is % related with the change you have just made. For example if don't % want to work anymore with the sine wave and you choose the random % signal, then you have to push the plot button in order to see the % plot of the random signal, and if you change of sampling method you % have to push the sampling button, when you changhe the sampling % window. So if you change the number of codewords or the number of % the iterations you will have to press the quantize button again. % Edit the above text to modify the response to help PCM % Last Modified by GUIDE v2.5 14-Mar-2007 12:32:35 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @PCM_OpeningFcn, ... 'gui_OutputFcn', @PCM_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout

Upload: faridadamabdillah

Post on 19-Jan-2016

3 views

Category:

Documents


1 download

DESCRIPTION

Pulse Code Modulation

TRANSCRIPT

Page 1: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

SOURCE CODE PROGRAM

function varargout = PCM(varargin)% PCM M-file for PCM.fig% PCM was designed in order to show how PCM works%% To simplify the undesrtanding of this method, the program first takes% a sine wave. Then you can choose a sampling scheme, and you can see% the output of the sampler. You can choose one out of three sampling % methods.% If you choose natural sampling; then you will have the chance to modify% the sampling window, and see the effects of this change in the output of% the sampler.%% Once you got the sampled signal you can quantize it by a method that is % known as two rules and an alorithm.% The option Squeezing and Stretching shows the best G(x) tha minimizes % the MSE. You can better understand this using the book% Telecommunications Demystified written by Carl Nassar. You can find% information about this on Chapter four of that book. % You can edit the bit's number and the number of iterations of the% algorithm. The bigger the number of bits, the smaller the MSE.% The picture shows the signal after quantization, the first iteration% in the quantization process and the output of the quantizer% % Then, by pressing the Bit Stream button you will see the PCM output% of the signal that you have selected in the input area.% % Everytime you change something, you must push the button that is% related with the change you have just made. For example if don't% want to work anymore with the sine wave and you choose the random% signal, then you have to push the plot button in order to see the% plot of the random signal, and if you change of sampling method you% have to push the sampling button, when you changhe the sampling % window. So if you change the number of codewords or the number of % the iterations you will have to press the quantize button again. % Edit the above text to modify the response to help PCM % Last Modified by GUIDE v2.5 14-Mar-2007 12:32:35 % Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @PCM_OpeningFcn, ... 'gui_OutputFcn', @PCM_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []);if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1});end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});else gui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT % --- Executes just before PCM is made visible.function PCM_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB

Page 2: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to PCM (see VARARGIN) % Choose default command line output for PCMhandles.output = hObject; % Update handles structureguidata(hObject, handles); % UIWAIT makes PCM wait for user response (see UIRESUME)% uiwait(handles.figure1); % --- Outputs from this function are returned to the command line.function varargout = PCM_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structurevarargout{1} = handles.output; % --- Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)% hObject handle to pushbutton2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)if (get(handles.radiobutton2,'Value') == get(handles.radiobutton2,'Max')) % Verifies if Sine wave was selected t=linspace(0,1,60); % Creates the time variable from 0 to 1 with a length of 60 or 60 points y=cos(2*pi*t); % Creates a sine wave of frequency 1 with the t vector axes(handles.axesanalog) % Select the proper axes plot(t,y); xlabel('Time'); ylabel('Amplitude'); grid on;elseif (get(handles.radiobutton3,'Value') == get(handles.radiobutton3,'Max')) % Verifies if Random signal was selected t=linspace(0,60,60); % Creates the time variable from 0 to 60 with a length of 60 or 60 points y=rand([1 60]); % Creates a random signal of length 60 or with 60 points axes(handles.axesanalog) % Select the proper axes plot(t,y); xlabel('Time'); ylabel('Amplitude'); grid on;endhandles.amp=y; % Saves the input signal y in the amp variable at the handles structurehandles.time=t; % Saves the input signal t in the time variable at the handles structureguidata(gcbo,handles); % Save the changes made to the handles structure % --- Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles)% hObject handle to pushbutton3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)close; % Close the application % --- Executes on button press in pushbutton4.function pushbutton4_Callback(hObject, eventdata, handles)% hObject handle to pushbutton4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)if (get(handles.radiobutton4,'Value') == get(handles.radiobutton4,'Max'))

Page 3: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

t=handles.time; % recover the saved variable t from the handles structure y=handles.amp; % recover the saved variable y from the handles structure p=ones(1, length(t)); % creates a vector containing only ones outideal=p.*y; % Multiplies the two vectors to get the output of an ideal sampler axes(handles.axessampled) % Select the proper axes stem(t,outideal,'ro'); xlabel('Time'); ylabel('Amplitude'); grid on; handles.signal=outideal; guidata(gcbo,handles);elseif (get(handles.radiobutton5,'Value') == get(handles.radiobutton5,'Max')) t=handles.time; % recover the saved variable t from the handles structure y=handles.amp; % recover the saved variable y from the handles structure p=ones(1, length(t)); % creates a vector containing only ones outhold=p.*y; % Multiplies the two vectors to get the output of an ideal sampler axes(handles.axessampled) % Select the proper axes stairs(t,outhold,'r'); %Plot the signal in a stairs shape making it looks like a zero order hold sampler xlabel('Time'); ylabel('Amplitude'); grid on; handles.signal=outhold; guidata(gcbo,handles);elseif (get(handles.radiobutton6,'Value') == get(handles.radiobutton6,'Max')) t=handles.time; % recover the saved variable t from the handles structure y=handles.amp; % recover the saved variable y from the handles structure test1=eval(get(handles.edit1,'String')); % Evals the value that is contained in the Edit 1 if isnan(test1) % Test if it is a number or not. If not it displays an error message errordlg('You must enter a numeric value','Bad Input','modal') end lenp=length(t)/length(test1); %Calculates the length of the vector so it can make it a periodic signal with the %right size so it can work properly p=ones(1, lenp); % Creates a vector of only ones of lenght lenp per=test1'*p; % Creates a matrix, containing lenp times the vector test1 per=per(:); % Concatenates the columns of the matrix so it becomes a vector outnormal=per'.*y; % Multiplies the two vectors to get the output of a normal sampler axes(handles.axessampled) % Select the proper axes plot(t,outnormal,'r'); xlabel('Time'); ylabel('Amplitude'); grid on; handles.signal=outnormal; guidata(gcbo,handles);end function edit1_Callback(hObject, eventdata, handles)% hObject handle to edit1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit1 as text% str2double(get(hObject,'String')) returns contents of edit1 as a double % --- Executes during object creation, after setting all properties.function edit1_CreateFcn(hObject, eventdata, handles)% hObject handle to edit1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.

Page 4: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end % --- Executes on button press in radiobutton6.function radiobutton6_Callback(hObject, eventdata, handles)% hObject handle to radiobutton6 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of radiobutton6if (get(handles.radiobutton6,'Value') == get(handles.radiobutton6,'Max')) set(handles.edit1,'Enable', 'on'); % Enables the Edit1 object once this radiobutton is selectedend % --- Executes on button press in radiobutton4.function radiobutton4_Callback(hObject, eventdata, handles)% hObject handle to radiobutton4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of radiobutton4if (get(handles.radiobutton6,'Value') == get(handles.radiobutton6,'Min')) set(handles.edit1,'Enable', 'off'); % Disables the Edit1 object once this radiobutton is selectedend % --- Executes on button press in radiobutton5.function radiobutton5_Callback(hObject, eventdata, handles)% hObject handle to radiobutton5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of radiobutton5if (get(handles.radiobutton6,'Value') == get(handles.radiobutton6,'Min')) set(handles.edit1,'Enable', 'off'); % Disables the Edit1 object once this radiobutton is selectedend % --- Executes on button press in pushbutton5.function pushbutton5_Callback(hObject, eventdata, handles)% hObject handle to pushbutton5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)s=handles.signal; % Recover the saved variable s from the handles structuret=handles.time; % Recover the saved variable t from the handles structureif (get(handles.radiobutton7,'Value') == get(handles.radiobutton7,'Max')) set(handles.edit2,'Enable', 'on'); % Enables the Edit2 object set(handles.edit3,'Enable', 'on'); % Enables the Edit3 object num=eval(get(handles.edit2,'String')); % Gets the value from the Edit2 Object limit=eval(get(handles.edit3,'String')); % Gets the value from the Edit3 Object % Creates an structure to represent the groups that are mapped from the % codewords for i=1:num i=int2str(i); i=strcat('n',i); r.(i)=[]; end s=num*s; % Normalized the signal. mins=min(s); % The minimun value in the signal maxs=max(s); % The maximum value in the signal cb=linspace(mins,maxs,num); % Creates the codeblocks from mins, % to maxs with num divisions cbd=[0:(length(cb)-1)]; % Code Created only with symbolic propueses, to %make easier the plotting process of the digital signal because it

Page 5: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

%doesn't have negative values. e=100; % Initialize the error. % Quantize the Signal with the algorithm described in the book % Telecommunications Demystified. for i= 1:limit; for j= 1:length(s) for k = 1:num temp(k)=(s(j)-cb(k))^2; end index=find(temp==min(temp)); index=index(1); numind=index; index=int2str(index); index=strcat('n',index); r.(index)=horzcat(r.(index),s(j)); squan(j)=cb(numind); squand(j)=cbd(numind); if (i==1) first=squan; end end err=(s-squan).^2; e=mean(err); if (e<limit/100) break; end for k = 1:num index=int2str(k); index=strcat('n',index); cbn(k)=mean(r.(index)); end cb=cbn; end set(handles.text5,'Visible', 'on'); % Makes visible the text5 set(handles.text6,'Visible', 'on'); % Makes visible the text6 set(handles.text6,'String', e); % Puts e on text6 axes(handles.axesquan) % Select the proper axes plot(t,s,t,first,'g',t,squan,'r'); % Plots the quantized signal xlabel('Time'); ylabel('Amplitude'); legend('Original Signal','First Quantization','After Quantization'); grid on; handles.quan=squan; handles.quand=squand; handles.nbit=num; handles.cbd=cbd; handles.cb=cb; guidata(gcbo,handles);elseif (get(handles.radiobutton8,'Value') == get(handles.radiobutton8,'Max')) s=handles.signal; maxs=max(s); t=handles.time; [pdfs,xp]=ksdensity(s); index=1; for i=1:length(xp) if (xp(i)<0 & xp(i+1)>0) index=i; break end end pdfs=pdfs(index:end); xp=xp(index:end); pdfs=pdfs.^3; p=polyfit(pdfs,xp,6); psym=poly2sym(p); g=int(psym); gn=sym2poly(g); gn=polyval(gn,t);

Page 6: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

maxgn=max(gn); thefact=maxs/maxgn; gn=gn*thefact; axes(handles.axesquan) % Select the proper axes plot(t,gn); xlabel('Time'); ylabel('Amplitude'); legend('Best G(x) that minimizes the mse') grid on;end function edit2_Callback(hObject, eventdata, handles)% hObject handle to edit2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit2 as text% str2double(get(hObject,'String')) returns contents of edit2 as a double % --- Executes during object creation, after setting all properties.function edit2_CreateFcn(hObject, eventdata, handles)% hObject handle to edit2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function edit3_Callback(hObject, eventdata, handles)% hObject handle to edit3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit3 as text% str2double(get(hObject,'String')) returns contents of edit3 as a double % --- Executes during object creation, after setting all properties.function edit3_CreateFcn(hObject, eventdata, handles)% hObject handle to edit3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end % --- Executes on button press in radiobutton8.function radiobutton8_Callback(hObject, eventdata, handles)% hObject handle to radiobutton8 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)set(handles.edit2,'Enable', 'off'); set(handles.edit3,'Enable', 'off');

Page 7: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

set(handles.text5,'Visible', 'off');set(handles.text6,'Visible', 'off');% Hint: get(hObject,'Value') returns toggle state of radiobutton8 % --- Executes on button press in radiobutton7.function radiobutton7_Callback(hObject, eventdata, handles)% hObject handle to radiobutton7 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)set(handles.edit2,'Enable', 'on'); set(handles.edit3,'Enable', 'on');% Hint: get(hObject,'Value') returns toggle state of radiobutton7 % --- Executes during object creation, after setting all properties.function pushbutton5_CreateFcn(hObject, eventdata, handles)% hObject handle to pushbutton5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % --- Executes on button press in pushbutton6.function pushbutton6_Callback(hObject, eventdata, handles)% hObject handle to pushbutton6 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)cb=handles.cb;cbd=handles.cbd;squand=handles.quand;nbit=handles.nbit;nbit=round(sqrt(nbit));lsquand=length(squand);for i=1:lsquand sbin(i,:)=de2bi(squand(i),nbit);endfigurehold on[m,n]=size(sbin);liminf=0;s1={'Quantized Signal','Symbol','Digital Signal'};bins=dec2bin(cbd,nbit);xlswrite('Output',s1,'Hoja1','A1');xlswrite('Output',cb','Hoja1','A2');xlswrite('Output',cbd','Hoja1','B2');xlswrite('Output',bins,'Hoja1','C2');nconst=n;for i = 1:m sbint=sbin(i,:); timet=[liminf:n-1]; if rem(i,2)==0 stem(timet, sbint,'r'); else stem(timet, sbint,'k'); end liminf=n; n=n+nconst;endgrid on

Page 8: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

% --------------------------------------------------------------------function Untitled_1_Callback(hObject, eventdata, handles)% hObject handle to Untitled_1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)helpdlg('In order to understand this program in a deeper way, it is desirable to have the book Telecommunications Demystified of Carl Nassar, it is possible to have an electronic version of the book. You can work with the chapter four of the book.', 'Recomendations'); % --------------------------------------------------------------------function Untitled_2_Callback(hObject, eventdata, handles)% hObject handle to Untitled_2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % --- Executes on button press in pushbutton7.function pushbutton7_Callback(hObject, eventdata, handles)% hObject handle to pushbutton7 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

Page 9: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

Hasil Tampilan Program:

Ketika program dijalankan dengan memilih signal input sine dan metode sampling ideal sampling, didapatkan tampilan sampling seperti berikut :

Kemudian diubah nilai iterasi dan codewords program menjadi dua kali nilai semula sehingga menampilkan output tampilan sebagai berikut :

Perbedaan tampilan gelombang output yang dihasilkan adalah terletak pada besarnya amplitude. Pada tampilan pertama nilai dari amplitudenya adalah 8 sesuai

Page 10: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

dengan input dari number of codewords yang dimasukkan. Sedangkan pada tampilan kedua nilai dari ampiltudenya menjadi dua kali dari tampilan pertama yaitu 16 sesuai dengan nilai dari number of codewordsnya. Sedangkan jika metode sampling yang digunakan diubah menjadi zero order hold maka tampilan samplingnya akan menjadi seperti berikut :

Jika menggunakan metode sampling natural sampling maka tampilannya akan menjadi sebagai berikut :

Page 11: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

Ketika menggunakan input sinyal sine dengan sampling metode quantizernya squeezing and stretching maka tampilan signal setelah mengalami proses quantizer menjadi seperti berikut :

Sedangkan jika menggunakan inputan signal random dengan metode ideal sampling, didapatkan hasil tampilan gelombang sebagi berikut :

Jika nilai iterasi diperbesar maka akan tampak seperti berikut :

Page 12: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

Kembali ke inputan sinyal sine dengan mengubah nilai iterasi menjadi 10 dan menampilkan hasil figure yang menghasilkan gelombang noise pada PCM

Page 13: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

Ketika Memakai inputan signal random quantize, hasil outputnya menghasilkan sebuah gelombang sinyal noise.

Page 14: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

Langkah awal :

dilakukan pendeklarasian suatu general sinyal yang akan menjadi inputan awal, sinyal inputan inilah yang kemudian akan mengalami modulasi sinyal menjadi sebuah data analog.

Langkah selanjutnya :

Dilakukan proses modulasi pulsa untuk mengubah sinyal inputan menjadi analog

dengan menggunakan PCM (Pulse Code Modulator). Sinyal yang telah termodulasi akan

Page 15: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

terbaca sebagai pulsa yang memiliki nilai biner 1 atau 0. Atau yang biasa dikenal sebagai

nilai high dan low.

Setelah proses encoding selesai, sinyal hasil encoding tersebut di kembalikan lagi ke

dalam bentuk sinyal ideal untuk kemudian diterjemahkan kembali ke dalam bentuk data

aslinya dalam proses modulasi sinyal. Berikut ini adalah gambaran dari pengolahan data

dalam proses modulasi :

Page 16: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

Gambar signal beberapa signal di atas, adalah output dari encoded signal. Setiap pulsa memiliki nilai sandi biner masing-masing yang nantinya akan diterjemahkan menjadi sinyal output. Sandi biner tersebut akan mengalami proses decoding untuk mengembalikan pulsa menjadi bentuk sinyal ideal seperti inputan sebelumnya,

Setelah mengalami proses decoding, pulsa tersebut kemudian di terjemahkan kembali menjadi sinyal inputan sebelumnya dengan hasil pada figure di bawah ini :

Langkah terakhir :

Tampilan sinyal decoding di bandingkan dengan sinyal inputan sebelumnya, apakah signal yang telah mengalami proses encoding dan decoding tersebut telah sama seperti sinyal aslinya. Apabila proses encoding dan decoding benar maka sinyal hasil proses encoding dan decoding memiliki tampilan yang sama seperti sinyal inputan sebelumnya.

Page 17: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

ANALISA DATA

Dalam PCM .math ini pula tedapat 2 inputan signal yaitu sine dan random. Apabila input signal sine kita pilih sebagai inputan awal untuk menampilkan sebuah frekuensi maka hasil nya sebuah gelombang normal. Yaitu gelombang sinus. Sedangkan apabila menggunakan inputant signal random maka hasilnya sebuah gelombang noise. Jika digunakan metode sampling dengan ideal sampling maka tampilan gelombang adalah gelombang sinus ideal, dan apabila dilakukan perbesaran terhadap nilai iterasi pada inputan iterations dan number of codewords maka akan tampak perbedaan tampilan dari sampling gelombang tersebut.

Perbedaan tampilan gelombang output yang dihasilkan adalah terletak pada

besarnya amplitude. Pada tampilan pertama nilai dari amplitudenya adalah 8 sesuai

dengan input dari number of codewords yang dimasukkan. Sedangkan pada tampilan

kedua nilai dari ampiltudenya menjadi dua kali dari tampilan pertama yaitu 16 sesuai

dengan nilai dari number of codewordsnya. Sedangkan jika metode sampling yang

digunakan diubah menjadi zero order hold maka tampilan samplingnya akan menjadi

seperti gelombang sinus cacat. Jika inputan sinyal yang digunakan adalah sinyal random,

maka tampilan sampling gelombang setelah dilakukan quantizer seperti tampilan sinyal

acak / random signal. PCM (Pulse Code Modulator) juga dapat digunakan untuk melakukan

Page 18: PCM

DIAn KArtika sari [7211040011] 2 D4 TELKOM A

proses modulasi sinyal. Sinyal yang telah termodulasi akan terbaca sebagai pulsa yang

memiliki nilai biner 1 atau 0. Atau yang biasa dikenal sebagai nilai high dan low.

KESIMPULAN

Dari percobaan meggunakan PCM (Pulse Code Modulation) ini dapat di simpulkan bahwa :

1. Apabila proses encoding dan decoding benar maka sinyal hasil proses encoding dan decoding memiliki tampilan yang sama seperti sinyal inputan sebelumnya.

2. Sinyal yang telah termodulasi akan terbaca sebagai pulsa yang memiliki nilai 1

atau 0.

3. Apabila proses modulasi sinyal yang dilakukan benar maka sinyal hasil proses encoding dan decoding memiliki tampilan yang sama seperti sinyal inputan sebelumnya.

4. Inputan sinyal yang akan digunakan, sangat berpengaruh dengan hasil output

gelombang signal pada sampling dan amplitude yang di hasilkan.