synthesizablematlab.m

来自「Lab 2 – Synthesizable MATLAB This lab e」· M 代码 · 共 33 行

M
33
字号
%       AccelDSP 8.1.1 build 690 Production, compiled Apr 26 2006 
% 
%    THIS IS UNPUBLISHED, LICENSED SOFTWARE THAT IS THE CONFIDENTIAL 
%        AND PROPRIETARY PROPERTY OF XILINX OR ITS LICENSORS 
% 
%     Copyright(c) Xilinx, Inc., 2000-2006, All Rights Reserved. 
%     Reproduction or reuse, in any form, without the explicit written 
%     consent of Xilinx, Inc., is strictly prohibited. 

clc;clear all;close all;

% Create the filter coefficients
NUMSAMPS = 1024*2;
NUMTAPS = 32;
BE = 0.25;
b = fir1(NUMTAPS-1,BE);
state = zeros(NUMTAPS-1,1);

% Create the input stimulus
rand('state',0);
scale = 2*sqrt(12); 
x = (rand(1,NUMSAMPS)-0.5)*scale;

% Filter the data

[y,state] = filter(b,1,x,state);

% Generate power spectral density of the filter outputs
[Pout,Wout]=aw_psd(y,1024,2);

% Superimpose the actual response onto the ideal response
plot(Wout,10*log10(Pout),'r');

⌨️ 快捷键说明

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