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

📄 fft8_test.m

📁 快速离散傅立叶变换
💻 M
字号:
%fft8_test
clear all; close all; clc; 
randn('state',1); x=randn(1,8)+j*randn(1,8);
%x=fft(1:1536)/sqrt(1536); y=x; delta=0.5+0.5i;

%bit_width for fix-point input x with std=2^(bit_width-4)
bit_width=16; M=2^(bit_width-4); y=x*M; s=y; delta=0.5+0.5i;x=y;
% x=1:8;
%filv



y1=fft(x)/sqrt(8);
y2=fft8(x,1);
for n2=0:1 for n1=0:1 for n0=0:1
           y(4*n0+2*n1+n2+1)=y1(4*n2+2*n1+n0+1);
end;end;end;
er=y-y2;
figure;subplot(2,1,1);plot(real(er),'b.');subplot(2,1,2);plot(imag(er),'b.');

for n2=0:1 for n1=0:1 for n0=0:1
           y(4*n0+2*n1+n2+1)=y1(4*n2+2*n1+n0+1);
end;end;end;
x1=ifft(y1)*sqrt(8);
x2=fft8(y,0);
er=x1-x2;
figure;subplot(2,1,1);plot(real(er),'b.');subplot(2,1,2);plot(imag(er),'b.');

er1=x1-x;
figure;subplot(2,1,1);plot(real(er1),'b.');subplot(2,1,2);plot(imag(er1),'b.');
er2=x2-x;
figure;subplot(2,1,1);plot(real(er2),'b.');subplot(2,1,2);plot(imag(er2),'b.');

⌨️ 快捷键说明

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