DFS
程序员文章站
2022-03-19 13:22:07
...
matlab计算时,选一个主区间计算
function [Xk] = dfs(xn,N)
% Compute DFS
% Xk = DFS coeff. array over 0<=k<=N-1;
% xn = One period of periodic signal over 0<=n<=N-1;
% N = Fundamental period of xn
n = [0:1:N-1];
k = [0:1:N-1];
WN = exp(-1j*2*pi/N);
nk = n'*k;
WNnk = WN.^nk;
Xk = xn * WNnk;
end
function [xn] = idfs(Xk,N)
% Compute DFS
% Xk = DFS coeff. array over 0<=k<=N-1;
% xn = One period of periodic signal over 0<=n<=N-1;
% N = Fundamental period of xn
n = [0:1:N-1];
k = [0:1:N-1];
WN = exp(-1j*2*pi/N);
nk = n'*k;
WNnk = WN.^(-nk);
xn = (Xk * WNnk)/N;
end
clear all, close all, clc;
xn = [0,1,2,3];
N = 4;
xk = dfs(xn,N)
xn_1 = idfs(xk,N)
上一篇: 详解如何在 docker 容器中捕获信号
下一篇: 超实用干货!手机网站导航怎么设计才够炫
推荐阅读
-
迷宫自动生成以及基于DFS的自动寻路算法
-
HDU 5215 Cycle(dfs判环)
-
dfs
-
Too Rich HDU - 5527 (贪心+dfs)
-
Win2003利用dfs(分布式文件系统)在负载均衡下的文件同步配置方案
-
DFS和BFS讲解及Leetcode刷题小结(1)(JAVA)
-
【每日一道算法题】Leetcode之longest-increasing-path-in-a-matrix矩阵中的最长递增路径问题 Java dfs+记忆化
-
I - Beat HDU - 2614 DFS
-
Codeforces Round #656 (Div. 3)D. a-Good String(递归+dfs)
-
515 在每个树行中找最大值(dfs)