📄 speech2.m
字号:
function [ S,A,X,Fs ] = Speech2;% Speech2 is used to generate the mixed signal of of two short speech of% different languages.% Usage:% [S,A,X,Fs] = Speech2;% Input: none%Output:% * S is the column vectors of original signals% * A is the random mixing matrix% * X is the column vectors of mixed signals% * Fs is the sampling rate% Note:% To keep the consistency of all m files, the signal provided by% Speech4 should be tansposed first since Speech4.mat is read in the% form of row vectors% %----------------------Main Program----------------------%load D:\王景\课程\毕业设计\Paper_Temp\张小兵\Benchmark\Speech4.mat;Fs=8192; % How to figure out the sampling rate of a signal?t=[0:size(Speech4,2)-1]'/Fs;A=rand(2);S=Speech4([1 4],:)';X=S*A; len=200;%pause; %For test only% Note:% *'len' is the length of of data that is going to be ploted% * In this m file, we just mix the first and the last speechs of% Speech4.mat with mixing matrix A, which is executed by line 26.%----------------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 + -