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

📄 property3.m

📁 用dsp解压mp3程序的算法
💻 M
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% property3 - Program for showing Circular shifting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

x = [1 0.8 0.6 0.4 0.2 0.1 0.3 0.5];

% Circular shift by 2 time units

shift = 2;
n = 0:1:length(x)-1;
n = mod(n-shift,8);
x_cs = x(n+1);

figure;
subplot(211); stem(0:1:length(x)-1,x); title('Original sequence');
subplot(212); stem(0:1:length(x)-1,x_cs); title('Circular shifted by 2');

% FFT of x and x_cs

X = fft(x); mag_X = abs(X); phase_X = angle(X); 
X_cs = fft(x_cs); mag_X_cs = abs(X_cs); phase_X_cs = angle(X_cs);

figure; n1 = 0:1:7
subplot(221), stem(n1,mag_X); title ('Magnitude of original seq');
subplot(222), stem(n1,phase_X); title ('Phase of original seq');
subplot(223), stem(n1,mag_X_cs); title ('Magnitude of Circular-shifted seq');
subplot(224), stem(n1,phase_X_cs); title ('Phase of Circular-shifted seq');


⌨️ 快捷键说明

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