⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 time_to_frequency_domain.m

📁 The Finite Difference Time Domain Method for Electromagnetics With MATLAB Simulations Atef Elshe
💻 M
字号:
function [X] = time_to_frequency_domain(x,dt,frequency_array,time_shift)
% x  : array including the sampled values at discrete time steps
% dt : sampling period, duration of an FDTD time step
% frequency_array : list of frequencies for which transform is performed
% time_shift : a value in order to account for the time shift between 
% electric and magnetic fields

number_of_time_steps  = size(x,2);
number_of_frequencies = size(frequency_array,2);
X = zeros(1, number_of_frequencies);
w = 2 * pi * frequency_array;
for n = 1:number_of_time_steps
    t = n * dt + time_shift;
    X = X + x(n) * exp(-j*w*t);
end
X = X * dt;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -