RDS
RDS的0,1波形函数可通过如下函数运算得到:
这里是引用
相邻码元就有4种组合方式:00,01,10,11。钟周期和数据传输速率为1187.5Hz,1187.5bit/s±0.125bit/s;载波频率为导频的三倍即57kHz–L6Hz,对主载波标准频偏±1.0~±7.5kHz;
RDS信号加57khz载波后,一个周期采577个点
对matlab代码如下
clc;
clear;
syms f t T td;
f=1187.5;
T=1./f;
t=linspace(-2.*T,4.T,5776);
A=(2./pi./(8.t+T)).(cos(4.*pi.*t./T));
B=(2./pi./(8.t-T)).(cos(4.*pi.*t./T));
C=(2./pi./(8.t-3.T)).(cos(4.pi.t./T));
D=(2./pi./(8.t-5.T)).(cos(4.pi.t./T));
A2=(2./pi./(8.(t-T)+T)).(cos(4.pi.(t-T)./T));
B2=(2./pi./(8.(t-T)-T)).(cos(4.pi.(t-T)./T));
C2=(2./pi./(8.(t-T)-3.T)).(cos(4.pi.(t-T)./T));
D2=(2./pi./(8.(t-T)-5.T)).(cos(4.pi.(t-T)./T));
sin_1wave1=(A-B-C+D)./1612.8;
sin_0wave1=(-A+B+C-D)./1612.8;
sin_1wave2=(A2-B2-C2+D2)./1612.8;
sin_0wave2=(-A2+B2+C2-D2)./1612.8;
%%移位相加
Y_00=(sin_0wave1+sin_0wave2);
Y_01=(sin_0wave1+sin_1wave2);
Y_10=(sin_1wave1+sin_0wave2);
Y_11=(sin_1wave1+sin_1wave2);
%%加57K载波
modu_00=Y_00.*sin(t.*2.*pi.*57000);
modu_01=Y_01.*sin(t.*2.*pi.*57000);
modu_10=Y_10.*sin(t.*2.*pi.*57000);
modu_11=Y_11.*sin(t.*2.*pi.*57000);
%%取点(3/4T-7/4T)(除最大值 使采点幅值到小于1)
modu_p00=1./1.0120.*modu_00(1731-577./4:2307-577./4);
modu_p01=1./1.0082.*modu_01(1731-577./4:2307-577./4);
modu_p10=1./1.0082.*modu_10(1731-577./4:2307-577./4);
modu_p11=1./1.0120.*modu_11(1731-577./4:2307-577./4);
%%输出叠加图
figure(1);
plot(t,sin_0wave1,‘b’,t,sin_0wave2,‘r’);
xlabel(‘t/s’);
ylabel(‘V/v’);
title(‘sinwave00’);
grid on;
% figure(1);
% plot(t,sin_0wave1,‘b’,t,sin_0wave2,‘r’);
% xlabel(‘t/s’);
% ylabel(‘V/v’);
% title(‘sinwave01’);
% grid on;
% figure(1);
% plot(t,sin_0wave1,‘b’,t,sin_1wave2,‘r’);
% xlabel(‘t/s’);
% ylabel(‘V/v’);
% title(‘sinwave01’);
% grid on;
% figure(1);
% plot(t,sin_1wave1,‘b’,t,sin_0wave2,‘r’);
% xlabel(‘t/s’);
% ylabel(‘V/v’);
% title(‘sinwave10’);
% grid on;
figure(1);
plot(t,sin_1wave1,‘b’,t,sin_1wave2,‘r’);
xlabel(‘t/s’);
ylabel(‘V/v’);
title(‘sinwave11’);
grid on;
%%直接相加A+B
figure(2);
subplot(2,2,1)
plot(t,Y_00,‘g’);
xlabel(‘t/s’);
ylabel(‘V/v’);
title(‘sinwave00’);
grid on;
subplot(2,2,2)
plot(t,Y_01,‘g’);
xlabel(‘t/s’);
ylabel(‘V/v’);
title(‘sinwave01’);
grid on;
subplot(2,2,3)
plot(t,Y_10,‘g’);
xlabel(‘t/s’);
ylabel(‘V/v’);
title(‘sinwave10’);
grid on;
subplot(2,2,4)
plot(t,Y_11,‘g’);
xlabel(‘t/s’);
ylabel(‘V/v’);
title(‘sinwave11’);
grid on;
%%输出加57khz载波图
figure(3);
subplot(2,2,1)
plot(t,modu_00,‘m’);
xlabel(‘t/s’);
ylabel(‘V/v’);
title(‘sinwavem00’);
grid on;
subplot(2,2,2)
plot(t,modu_01,‘m’);
xlabel(‘t/s’);
ylabel(‘V/v’);
title(‘sinwavem01’);
grid on;
subplot(2,2,3)
plot(t,modu_10,‘m’);
xlabel(‘t/s’);
ylabel(‘V/v’);
title(‘sinwavem10’);
grid on;
subplot(2,2,4)
plot(t,modu_11,‘m’);
xlabel(‘t/s’);
ylabel(‘V/v’);
title(‘sinwavem11’);
grid on;
%%截取点图
%00
figure(4);
x=linspace(3/4.*T,7/4.*T,577);
subplot(2,2,1)
plot(x,modu_p00,‘m’);
xlabel(‘t/s’);
ylabel(‘V/v’);
title(‘modu_p00’);
%01
x=linspace(3/4.*T,7/4.*T,577);
subplot(2,2,2)
plot(x,modu_p01,‘m’);
xlabel(‘t/s’);
ylabel(‘V/v’);
title(‘modu_p01’);
%10
x=linspace(3/4.*T,7/4.*T,577);
subplot(2,2,3)
plot(x,modu_p10,‘m’);
xlabel(‘t/s’);
ylabel(‘V/v’);
title(‘modu_p10’);
%11
x=linspace(3/4.*T,7/4.*T,577);
subplot(2,2,4)
plot(x,modu_p11,‘m’);
xlabel(‘t/s’);
ylabel(‘V/v’);
title(‘modu_p11’);
%%转化幅值0-100以内(上移1,再乘以50)
T_00 = round((modu_p00+1).*255./2);
T_01 = round((modu_p01+1).*255./2);
T_10 = round((modu_p10+1).*255./2);
T_11 = round((modu_p11+1).*255./2);
%sprintf(‘0x%x,’,T_00)
%sprintf(‘0x%x,’,T_01)
sprintf(‘0x%x,’,T_10)
%sprintf(‘0x%x,’,T_11)
%%转化成16进制
%hhd1=dec2hex(T_00);
%hhd2=dec2hex(T_01);
%hhd3=dec2hex(T_10);
%hhd4=dec2hex(T_11);