image thumbnail

PSK31 Model with Symbol Timing and Carrier Recovery

by

 

09 Dec 2002 (Updated )

Updated version of PSK31 communication standard that is now R2013B compliant.

make_bits(msg)
function [bitstream,char_table]=make_bits(msg)
% make a test transmission from msg
% Copyright 2002-2010 The MathWorks, Inc.
[vctable char_table]=load_alpha;   % varicode table index to 1+abs('c')
bitstream = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];   % idle bits
for k=1:length(msg)
    index=1+abs(msg(k));        % get ascii index (interesting use of the abs() function)
    vc=char(vctable(index));    % look up varicode bits
    kof=length(bitstream);
    bitstream([kof+(1:2)])=[0,0]; % 2 consecutive zeros is a character break
    for i=1:length(vc)
        bitstream(kof+2+i)=str2num(vc(i)); 
    end;
end;

Contact us