代码搜索结果
找到约 36,166 项符合
Raspberry Pi 的代码
qampsk_modulate.m
function s=qampsk_modulate(R,Q_modu)%输入为编码后的,输出为复数点Q=4or16or8
if Q_modu==4
table=exp(j*[pi/4 ,3*pi/4 ,-pi/4,-3*pi/4]);%mapping表
table=table([1,3,2,4]);
s=table([ 2 1]*R+1);%s为mapping后的复数点
3-4.m
%例程3-4 产生锯齿波形
Fs=1000;
t=0:1/Fs:3;
x=sawtooth(2*pi*t);
y=sawtooth(2*pi*t,0.5);
z=sawtooth(2*pi*t,1);
subplot(3,1,1);
plot(t,x);
subplot(3,1,2);
plot(t,y);
subplot(3,1,3);
plo
3-12.m
%例程3-12 求解单位冲击响应的幅频
N=20;
a=[0.4 0.3 -1];
b=[1 -0.2 0.6 0.3];
x=[1 zeros(1,N-1)];
k=0:N-1;
y=filter(a,b,x);
Fs=1000;
w=0:pi/Fs:pi;
h=freqz(a,b,w);
subplot(2,1,1);
stem(k,y);
3-1.m
%例程3-1 计算序列抽样和与序列能量
t=(0:0.1:10)';
x=sin(2*pi*t)+2*cos(pi*t);
y=x+randn(size(t));
s=sum(x(1:100));
E=sum(abs(y).^2);
subplot(2,2,1);
plot(t,x);
title('X');
subplot(2,2,2);
plot(t,y);
ti
3-3.m
%例程3-3 产生方波波形
t=0:0.1*pi:4*pi;
x=square(t);
y=square(t,30);
subplot(2,1,1);
plot(t,x);
axis([0 5*pi -1.5 1.5]);
subplot(2,1,2);
plot(t,y);
axis([0 5*pi -1.5 1.5]);
3-6.m
%例程3-6 产生Dirichlet函数波形
t=[-4*pi:0.1:4*pi];
x=diric(t,7);
y=diric(t,6);
subplot(2,1,1);
plot(t,x);
subplot(2,1,2);
plot(t,y);
4-16.m
%例程4-16 利用汉宁窗设计Ⅰ型数字高通滤波器
clear all;
Wp=0.6*pi;
Ws=0.4*pi;
tr_width=Wp-Ws; %过渡带宽度
N=ceil(6.2*pi/tr_width) %滤波器长度
n=0:1:N-1;
Wc=(Ws+Wp)/2;
4-25.m
%例程4-25 基于频率抽样方法2实现Ⅲ型FIR数字带通滤波器
clear all;
N=41;
T1=0.1095;
alpha= (N-1)/2;
l=0:N-1;
wl= (2*pi/N)*l;
Hrs=[zeros(1,6),T1,ones(1,7),T1,zeros(1,11),T1,ones(1,7),T1,zeros(1,6)];
4-5.m
%例程4-5 基于巴特沃斯模拟滤波器设计数字带阻滤波器
Wp=[0.4*pi,0.7*pi];
Ws=[0.2*pi,0.8*pi];
Ap=1;
As=30;
[N,wn]=buttord(Wp/pi,Ws/pi,Ap,As); %计算巴特沃斯滤波器阶次和截止频率
[b,a]=butter(N,wn,'stop'); %频率变换法设计巴特沃斯带通滤波器
[db,
4-23.m
%例程4-23 利用汉宁窗设计Ⅰ型数字带阻滤波器
clear all;
Wpl=0.2*pi;
Wph=0.8*pi;
Wsl=0.4*pi;
Wsh=0.6*pi;
tr_width=min((Wsl-Wpl),(Wph-Wsh)); %过渡带宽度
N=ceil(6.2*pi/tr_width)