📄 ir_tf.m
字号:
% IR_TF.m
% Draw Impulse Response and Transfer Function
function []=IR_TF(r, name)
%****************************** variables ******************************
% r Envelope of fading channel complex impulse response
% name Title of the diagram
%************************************************************************
% Impulse Response
IR = 20*log10(r);
figure;clf;stem(0:length(IR)-1,IR-max(IR));grid on
title(['Impluse Response', name]);
xlabel('Time Delay');
ylabel('Impuse Response(dB)');
% Transfer Function
TF = fft(r);
%TF = 10.*log10(TF.*conj(TF));
TF = 20.*log10(abs(TF));
figure;clf;plot(0:1/(length(TF)-1):1,TF);grid on
title(['Transfer Function', name]);
xlabel('Frequency(rad)');
ylabel('Transfer Function(dB)');
%***************************** end of file *******************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -