matlab code for ami coding
#1

function b_ami( bitstream )
%B_AMI Bipolar Alternate Mark Inversion
% sample data:
% d = [ 0 1 0 0 1 1 0 0 0 1 1 ]
% usage:
% b_ami(d)
% author:
% Anastasios Latsas

% pulse height
pulse = 5;

% assume that current pulse level is a "low" pulse (binary 1)
% this is the pulse level for the bit before given bitstream
current_level = -pulse;

for bit = 1:length(bitstream)
% set bit time
bt=bit-1:0.001:bit;

if bitstream(bit) == 0
% binary 0, set to zero
y = zeros(size(bt));
else
% each binary 1 has the opposite pulse level from the previous
current_level = -current_level;
y = (bt<bit) * current_level;
end

% assign last pulse point by inspecting the following bit
try
% we care only about ones as they use alternate levels
if bitstream(bit+1) == 1
y(end) = -current_level;
end
catch e
% bitstream end; assume next bit is 0
y(end) = -current_level;
end

% draw pulse and label
plot(bt, y, 'LineWidth', 2);
text(bit-0.5, pulse+2, num2str(bitstream(bit)), ...
'FontWeight', 'bold')
hold on;
end
% draw grid
grid on;
axis([0 length(bitstream) -pulse*2 pulse*2]);
set(gca,'YTick', [-pulse 0 pulse])
set(gca,'XTick', 1:length(bitstream))
set(gca,'XTickLabel', '')
title('Bipolar Alternate Mark Inversion')
end
Reply
#2
i needed it very much .................thanks alot sir........ Smile
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: matlab code for ami coding, bipolar ami matlab code, verilog code for bipolar ami, ami zx865gv v2 1, binary to ami matlab source codel management in ppt, ami 865 sound card download, ami line code simulink,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  how to calculate distance in heed protocol by using matlab 1 1,890 15-06-2018, 03:54 PM
Last Post: Guest
  matlab code for incremental conductance mppt 1 1,426 02-05-2018, 02:28 PM
Last Post: eksi
  anomaly detection code in matlab 3 2,094 23-04-2018, 12:04 AM
Last Post: Guest
  matlab code for liver tumor segmentation 2 1,585 01-04-2018, 06:29 PM
Last Post: [email protected]
  matlab code for vehicle tracking using unscented kalman filter 3 16,916 26-03-2018, 08:57 PM
Last Post: fodayj
  travel agency vb6 0 project report with coding in pdf format 3 3,230 13-03-2018, 12:15 AM
Last Post: Guest
  matlab code for facial expression recognition using frequency domain 1 2,686 19-02-2018, 06:03 PM
Last Post: Guest
  matlab code shadow detection and removal in colour images using matlab 2 2,265 12-01-2018, 01:24 PM
Last Post: dhanabhagya
  simulink matlab model upqc mdl 3 6,779 18-12-2017, 09:08 AM
Last Post: jaseela123d
  matlab code for speed breaker detection 1 1,299 27-10-2017, 10:22 AM
Last Post: Guest

Forum Jump: