?? delay.asv
字號:
clear all;close all;clc;
fs=8000;
f=2500;
t=0:1/fs:1023/fs;
x=sin(2*pi*f*t);
y=sin(2*pi*f*t+pi/3);
X=fft(x,1024);
Y=fft(y,1024);
psd=csd(x,y);
d=atan(imag(max(psd))/real(max(psd)));
d=d*180/pi;
subplot(2,3,1),plot(x);
subplot(2,3,4),plot(abs(X),'r');
subplot(2,3,2),plot(y);
subplot(2,3,5),plot(abs(Y),'g');
subplot(2,3,3),plot(abs(psd));
subplot(2,3,6),plot(d,'x')
cell_string{1}='\fontsize{14}\fontname{隸書}相位差';
cell_string{2}=['\fontsize{14}\rmd = ' num2str(d)];
cell_string{3}='\fontsize{10}\downarrow';
text(0.97,d+0.5,cell_string)
%text(1,d+1,'{相位差}=60')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -