博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
信号基础知识
阅读量:4470 次
发布时间:2019-06-08

本文共 1123 字,大约阅读时间需要 3 分钟。

总是基础的知识老是忘,所以记录一下吧。

clc;close all;clear all; f0=10; fs=100;     %采样率 t=1/fs:1/fs:2;         %共两秒钟,共200个采样点。采样间隔T=1/100

y1=sin(2*pi*f0*t);

y2=square(2*pi*f0*t);

figure;

subplot(311); plot(t,y1); xlabel('time');ylabel('y1');title('y1=sin(2*pi*f0*t)---时域');

subplot(312); plot(t,y2); xlabel('time');ylabel('y2');title('y1=square(2*pi*f0*t)---时域');

noise=rand(1,200); subplot(313); plot(t,noise,'r'); xlabel('time');ylabel('noise');title('noise---时域');

%--------------------------------------------------------

z1=y1+noise;

z2=y2+noise;

figure;

subplot(211); plot(t,z1); xlabel('time');ylabel('z1');title('y1=sin(2*pi*f0*t)+noise---时域'); axis([0 0.5 0 2]);

subplot(212); plot(t,z2); xlabel('time');ylabel('y2');title('y1=square(2*pi*f0*t)+noise---时域'); axis([0 0.5 0 2]);

xiangguan_z1z2=xcorr(z1,z2);%%相关分析

juanji_z1z2=conv(z1,z2); %%卷积

figure;

subplot(311); plot(xiangguan_z1z2); title('相关性---z1z2');

subplot(312); plot(juanji_z1z2); title('卷积---z1z2');

subplot(313); plot(xiangguan_z1z2,'r');hold on;

plot(juanji_z1z2,'g');hold off;

legend('相关性---z1z2','卷积---z1z2');%卷积和相关不一样emmmm

转载于:https://www.cnblogs.com/kiki--xiunai/p/10709911.html

你可能感兴趣的文章
[转]SQL Server 性能调优(io)
查看>>
设计模式学习-每日一记(6.原型模式)
查看>>
LeetCode--018--四数之和(java)
查看>>
Redis消息队列
查看>>
电商网站架构设计
查看>>
http://jingyan.baidu.com/article/4dc40848e7b69bc8d946f127.html
查看>>
WCF netTcp配置
查看>>
数据类型转换
查看>>
Nodejs学习笔记(2) 阻塞/非阻塞实例 与 Nodejs事件
查看>>
什么是FreeMaker
查看>>
设计模式学习笔记(总结篇:模式分类)
查看>>
TCP的三次握手/建立连接
查看>>
Python 教程阅读笔记(一):使用解释器
查看>>
运算符重载
查看>>
SDWebImage 新版接口使用方法
查看>>
DataTable导出为word,excel,html,csv,pdf,.txt
查看>>
android ListView详解
查看>>
软件工程 第一次作业
查看>>
Content Server HA搭建
查看>>
[leetCode]Linked List Cycle I+II
查看>>