⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pcm_decode.m

📁 Matlab 模拟 CDMA 直接扩频。m序列生成矩阵为p(x) = 1 + x^5 + x^7 + x^8 + x^9 + x^13 + x^15。能画出每阶段的时域、频域图。
💻 M
字号:
function [ output ] = pcm_decode( bitsIn )%UNTITLED1 Summary of this function goes here%  Detailed explanation goes hereSLENGTH = length(bitsIn)/8;bytesIn = zeros(3,SLENGTH);for i = 1:SLENGTH,    bytesIn(1,i) = bitsIn(8*(i-1)+1);    for j = 2:4,        bytesIn(2,i) = bytesIn(2,i) + bitsIn(8*(i-1)+j)*2^(4-j);    end    for j = 5:8        bytesIn(3,i) = bytesIn(3,i) + bitsIn(8*(i-1)+j)*2^(8-j);    endend%==>== DECODE ====%output = zeros(1,SLENGTH);for i = 1:SLENGTH    % in case!    if bytesIn(2,i) == 0,        preByte = (1/2)^7;        preByte1 = 0;    else        preByte = (1/2)^(8-bytesIn(2,i));        preByte1 = preByte;    end    output(i) = (-1)^(bytesIn(1,i))*...                (preByte1+...                preByte*(bytesIn(3,i))/16);endclear preByte;clear preByte;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -