📄 sigmix_2ch.m
字号:
function [S,A,X,Fs] = Sigmix_2ch% Sigmix_2ch is used to generate a mixture of 2 sine signals at% 1kHz and 2kHz with 30800 sample at sampling rate of 16kHz% Usage: [S,A,X,Fs] = Sigmix_2ch% Input: none% Output:% *S is the original signals% *A is a random mixing matrix% *X is the mixed signals% *Fs is the sampling ratet=[1:30800]';Fs=16000; t=t/Fs;Fc=[1e3,2e3];S=sin(2*pi*t*Fc); A=rand(2);X=S*A; len=200;% Note:% *'len' is the length of of data that is going to be ploted%----------------This plot subfunction is just for test----------------%%plot_s(S,t,len); function plot_s(S,t,len);figure;subplot(211);%subplot(121);plot(t(1:len),S(1:len,1));ylabel('Orignal Signal S1');xlabel('Time(sec)');subplot(212);%subplot(122);plot(t(1:len),S(1:len,2));ylabel('Orignal Signal S2');xlabel('Time(sec)');% Fs %For test only%pause; %For test only%----------------This plot subfunction is just for test----------------%%plot_x(X,t,len);%function plot_x(X,t,len);figure;subplot(211);plot(t(1:len),X(1:len,1));ylabel('Mixed Signals X1');xlabel('Time(sec)');subplot(212);plot(t(1:len),X(1:len,2));ylabel('Mixed Signals X2');xlabel('Time(sec)');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -