Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
bitEEdh
Communication-theory-experiments-different-coding-methods
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
Communication-theory-experiments-different-coding-methods
/
MillerEncode.m
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
40 lines (39 loc) · 1.48 KB
master
Breadcrumbs
Communication-theory-experiments-different-coding-methods
/
MillerEncode.m
Copy path
Top
File metadata and controls
Code
Blame
40 lines (39 loc) · 1.48 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function [xe_miller,y_miller] = MillerEncode(x)
% 对长为1000的输入0/1序列x进行密勒编码,脉冲宽度、波形采样率和前两种编码相同
% x: 输入序列
% xe_miller: 密勒编码后的0/1序列
% y_miller: 向量,存储密勒码的值
xe_miller = zeros(1,2000);
y_miller = zeros(1,8000);
if x(1)==1
xe_miller(1:2) = [1,0]; % 若第1个码元为1,将起始码元编为高电平
end
for i = 2:1e3
if x(i)==1 % 若当前码元为1,当前码元起始位置不跳变,中间位置跳变
xe_miller(2*i-1) = xe_miller(2*i-2);
if xe_miller(2*i-2)==0
xe_miller(2*i) = 1;
else
xe_miller(2*i) = 0;
end
else % 若当前码元为0,需看前一个码元
if x(i-1)==0 % 若前一个码元为0,当前码元起始位置跳变,中间位置不跳变
if xe_miller(2*i-2)==0
xe_miller(2*i-1) = 1;
else
xe_miller(2*i-1) = 0;
end
xe_miller(2*i) = xe_miller(2*i-1);
else % 若前一个码元为1,当前码元起始位置不跳变,中间位置不跳变
xe_miller(2*i-1:2*i) = [xe_miller(2*i-2),xe_miller(2*i-2)];
end
end
end
for i = 1:2e3 % 按照波形采样率对编码后的码值向量赋值
switch xe_miller(i)
case 1
y_miller(4*i-3:4*i) = ones(1,4);
case 0
y_miller(4*i-3:4*i) = zeros(1,4);
end
end
You can’t perform that action at this time.