📄 tddmmfsk.m
字号:
add_line([sys,'/','MFSK mod/MFSK map'],[230,55;255,55])
add_line([sys,'/','MFSK mod/MFSK map'],[70,55;100,55])
add_line([sys,'/','MFSK mod/MFSK map'],[145,55;170,55])
set_param([sys,'/','MFSK mod/MFSK map'],...
'Mask Display','MFSK\nmap',...
'Mask Type','MFSK map')
set_param([sys,'/','MFSK mod/MFSK map'],...
'Mask Dialogue','Map input digital signal to analog tone space for FM modulation. The tone space\nis the frequency distance between two \nconsective digit numbers.|Tone space (Hz):|Input symbol interval and offset (sec):')
set_param([sys,'/','MFSK mod/MFSK map'],...
'Mask Translate','Ton=@1;td=@2;')
set_param([sys,'/','MFSK mod/MFSK map'],...
'Mask Help','This block maps the input digital signal to the analog signal, which is ready for the FM modulation. The input are integers in the range [0, M-1], where M is the M-ary number. Tone space is the frequency separation between two consective digits for the input signal. After FM, the modulated signal has a frequency in the range of [Fc, Fc+B]. B is the bandwidth of the FSK, B=(M-1) * Tone_space.')
set_param([sys,'/','MFSK mod/MFSK map'],...
'Mask Entries','Ton\/td\/')
% Finished composite block 'MFSK mod/MFSK map'.
set_param([sys,'/','MFSK mod/MFSK map'],...
'position',[75,48,155,92])
add_block('built-in/Inport',[sys,'/','MFSK mod/in_1'])
set_param([sys,'/','MFSK mod/in_1'],...
'position',[15,60,35,80])
add_block('built-in/Outport',[sys,'/','MFSK mod/out_1'])
set_param([sys,'/','MFSK mod/out_1'],...
'position',[290,60,310,80])
add_line([sys,'/','MFSK mod'],[160,70;185,70])
add_line([sys,'/','MFSK mod'],[275,70;285,70])
add_line([sys,'/','MFSK mod'],[40,70;70,70])
set_param([sys,'/','MFSK mod'],...
'Mask Display','plot(0,0,100,100,x,y);MFSK',...
'Mask Type','Passband FSK modulation')
set_param([sys,'/','MFSK mod'],...
'Mask Dialogue','Modulate the input digital signal using M-ary frequency shift keying method.|Tone space(Hz):|Symbol interval (sec):|Carrier frequency (Hz):|Initial phase (rad):|Sample frequency (sec):')
set_param([sys,'/','MFSK mod'],...
'Mask Translate','Ton=@1;td=@2;Fc=@3;Ph=@4;ts=@5;[x,y]=moduicon(7);')
set_param([sys,'/','MFSK mod'],...
'Mask Help','This block modulates a digital signal using FSK method. The modulation resets the modulation phase to be the specified initial phase at the beginning of each digit. Tone space is the frequency distance between two consecutive digits after modulation. The output signal has its frequency in the range [Fc, Fc + Tone_space*Max_In_Value], where Fc is the carrier frequency.')
set_param([sys,'/','MFSK mod'],...
'Mask Entries','M/td/5\/td\/100\/0\/ts\/')
% Finished composite block 'MFSK mod'.
set_param([sys,'/','MFSK mod'],...
'hide name',0,...
'position',[170,63,250,107])
% Subsystem ['Coherent',13,'MFSK demod'].
new_system([sys,'/',['Coherent',13,'MFSK demod']])
set_param([sys,'/',['Coherent',13,'MFSK demod']],'Location',[521,150,957,294])
% Subsystem ['Coherent',13,'MFSK demod/Min//max index'].
new_system([sys,'/',['Coherent',13,'MFSK demod/Min//max index']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Min//max index']],'Location',[192,461,623,564])
add_block('built-in/S-Function',[sys,'/',['Coherent',13,'MFSK demod/Min//max index/Maximum']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Min//max index/Maximum']],...
'function name','arymimai',...
'parameters','mima',...
'position',[240,20,320,40])
add_block('built-in/Outport',[sys,'/',['Coherent',13,'MFSK demod/Min//max index/out_1']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Min//max index/out_1']],...
'position',[335,20,355,40])
add_block('built-in/Zero-Order Hold',[sys,'/',['Coherent',13,'MFSK demod/Min//max index/Zero-Order',13,'Hold']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Min//max index/Zero-Order',13,'Hold']],...
'Sample time','td',...
'position',[165,14,200,46])
add_block('built-in/Inport',[sys,'/',['Coherent',13,'MFSK demod/Min//max index/in_1']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Min//max index/in_1']],...
'position',[65,20,85,40])
add_line([sys,'/',['Coherent',13,'MFSK demod/Min//max index']],[205,30;235,30])
add_line([sys,'/',['Coherent',13,'MFSK demod/Min//max index']],[325,30;330,30])
add_line([sys,'/',['Coherent',13,'MFSK demod/Min//max index']],[90,30;160,30])
set_param([sys,'/',['Coherent',13,'MFSK demod/Min//max index']],...
'Mask Display','Min/Max\ndemap',...
'Mask Type','Maximum/minimum index.')
set_param([sys,'/',['Coherent',13,'MFSK demod/Min//max index']],...
'Mask Dialogue','Choose the index of the input vector with\nmax/min value at sampling point. Hold the\nvalue for the rest of the period.|Symbol interval (sec):|''max'' or ''min'':')
set_param([sys,'/',['Coherent',13,'MFSK demod/Min//max index']],...
'Mask Translate','td=@1;mima=@2;')
set_param([sys,'/',['Coherent',13,'MFSK demod/Min//max index']],...
'Mask Help','This block outputs the index of the vector element that has the maximum or minimum value in the input vector. The computation starts at the sampling time point. The block holds the value for the rest of the interval.')
set_param([sys,'/',['Coherent',13,'MFSK demod/Min//max index']],...
'Mask Entries','td\/''max''\/')
% Finished composite block ['Coherent',13,'MFSK demod/Min//max index'].
set_param([sys,'/',['Coherent',13,'MFSK demod/Min//max index']],...
'hide name',0,...
'position',[225,28,305,72])
% Subsystem ['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband'].
new_system([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],'Location',[210,425,800,670])
add_block('built-in/Outport',[sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/out_1']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/out_1']],...
'position',[560,55,580,75])
add_block('built-in/Inport',[sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/in_1']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/in_1']],...
'position',[365,45,385,65])
add_block('built-in/S-Function',[sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Array sin']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Array sin']],...
'function name','arysin',...
'parameters','''cos''',...
'position',[325,85,375,105])
add_block('built-in/Sum',[sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Sum1']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Sum1']],...
'inputs','+++',...
'position',[265,75,290,115])
add_block('built-in/Product',[sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Product']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Product']],...
'position',[415,46,440,79])
add_block('built-in/S-Function',[sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int1']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int1']],...
'function name','schdint',...
'parameters','td, ts, limit',...
'Mask Display','Schdld\nreset-int')
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int1']],...
'Mask Type','Scheduled reset integration.')
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int1']],...
'Mask Dialogue','Reset the state to be zero(s) at the scheduled reset point.|Scheduled reset time inteval and offset:|Sample time and offset:|Modulo bound:')
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int1']],...
'Mask Translate','td=@1;ts=@2;limit=@3;')
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int1']],...
'Mask Help','This block resets the state(s) to be zero(s) at the begining of reset time inteval. The reset inteval can be a two elements vector with the second element being offset.')
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int1']],...
'Mask Entries','td\/ts\/Inf\/',...
'position',[470,44,530,86])
add_block('built-in/S-Function',[sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int']],...
'function name','schdint',...
'parameters','td, ts, limit',...
'Mask Display','Schdld\nreset-int')
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int']],...
'Mask Type','Scheduled reset integration.')
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int']],...
'Mask Dialogue','Reset the state to be zero(s) at the scheduled reset point.|Scheduled reset time inteval and offset:|Sample time and offset:|Modulo bound:')
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int']],...
'Mask Translate','td=@1;ts=@2;limit=@3;')
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int']],...
'Mask Help','This block resets the state(s) to be zero(s) at the begining of reset time inteval. The reset inteval can be a two elements vector with the second element being offset.')
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int']],...
'Mask Entries','td\/ts\/Inf\/',...
'position',[140,39,200,81])
add_block('built-in/Constant',[sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Shift key']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Shift key']],...
'Value','sft',...
'position',[60,48,80,72])
add_block('built-in/Constant',[sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Initial phase']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Initial phase']],...
'Value','Ph',...
'position',[80,113,100,137])
add_block('built-in/Zero-Order Hold',[sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Zero-Order',13,'Hold']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Zero-Order',13,'Hold']],...
'Sample time','td',...
'position',[135,184,170,216])
add_block('built-in/Clock',[sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Clock']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Clock']],...
'position',[35,160,55,180])
add_block('built-in/Sum',[sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Sum2']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Sum2']],...
'inputs','+-',...
'position',[205,160,230,195])
add_block('built-in/Gain',[sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Gain']])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband/Gain']],...
'Gain','Fc',...
'position',[70,155,110,185])
add_line([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],[535,65;555,65])
add_line([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],[390,55;410,55])
add_line([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],[445,65;465,65])
add_line([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],[295,95;320,95])
add_line([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],[380,95;400,95;410,70])
add_line([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],[85,60;135,60])
add_line([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],[205,60;225,60;225,80;260,80])
add_line([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],[105,125;230,125;230,95;260,95])
add_line([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],[60,170;65,170])
add_line([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],[235,180;250,180;260,110])
add_line([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],[115,170;200,170])
add_line([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],[115,170;130,200])
add_line([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],[175,200;180,200;180,185;200,185])
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],...
'Mask Display','Coherent\nMFSK dm\ncorr',...
'Mask Type','Passband coherent MFSK correlation')
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],...
'Mask Dialogue','Compute MFSK correlation. Take MFSK\nmodulated signal. Output a vector of\ncorrelation result.|M-ary number (input in range [0, M-1]):|Tone space (Hz):|Symbol interval and offset (sec):|Carrier frequency (Hz):|Initial phase (rad):|Sample time (sec):')
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],...
'Mask Translate','pi2=2*pi;N=@1;Fc=@4*pi2;Ph=@5;Ton=@2;sft=[0:N-1]*Ton*pi2;td=@3;ts=@6;')
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],...
'Mask Help','This block calculates the coherent correlation value of the input signal with a vector of sinusoidal signals. These sinusoidal signals have their frequency the same as that of FM modulated signal of possible resulting digits. The output is an M length vector. M is the M-ary number. The MFSK demodulation result is the index of the largest output, using the Min/max demap block.')
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],...
'Mask Entries','M\/Ton\/td\/Fc\/Ph\/ts\/')
% Finished composite block ['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband'].
set_param([sys,'/',['Coherent',13,'MFSK demod/Coh MFSK demod',13,'corr passband']],...
'hide name',0,...
'position',[100,28,180,72])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -