首页 > 代码库 > 《DSP using MATLAB》示例Example5.1
《DSP using MATLAB》示例Example5.1
终于看到第5章了,继续努力,加油!!!
代码:
xn = [0, 1, 2, 3]; N =4; Xk = dfs(xn,N)
用到的dfs函数:
function [Xk] = dfs(xn,N) %% Computes Discrete Fourier Series Coefficients %% --------------------------------------------- %% [Xk] = dfs(xn,N) %% 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]; % row vector for n k = [0:1:N-1]; % row vector for k WN = exp(-j*2*pi/N); % Wn factor nk = n‘*k; % creates a N by N matrix of nk values WNnk = WN .^ nk; % DFS matrix Xk = xn * WNnk; % row vector for DFS coefficients
运行结果:
《DSP using MATLAB》示例Example5.1
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。