# 5 麦片

050

2主题 0最佳答案
• 关注者： 1

 以下是我的MATLAB代码，这里的是双边谱，我想显示单边谱，请问大神，我该怎么修改？ %--------------- Preparation clear all; close all; clc; % Time Domain 0 to T T = 1000; fs = 1/T; t = (1:T)/T; freqs = 2*pi*(t-0.5-1/T)/(fs); % center frequencies of components f_1 = 2; f_2 = 24; f_3 = 288; % modes v_1 = (cos(2*pi*f_1*t)); v_2 = 1/4*(cos(2*pi*f_2*t)); v_3 = 1/16*(cos(2*pi*f_3*t)); % for visualization purposes wsub{1} = 2*pi*f_1; wsub{2} = 2*pi*f_2; wsub{3} = 2*pi*f_3; % composite signal, including noise f = v_1 + v_2 + v_3 + 0.1*randn(size(v_1)); % some sample parameters for VMD alpha = 2000;        % moderate bandwidth constraint tau = 0;            % noise-tolerance (no strict fidelity enforcement) K = 4;              % 4 modes DC = 0;             % no DC part imposed init = 1;           % initialize omegas uniformly tol = 1e-7; %--------------- Run actual VMD code [u, u_hat, omega] = VMD(f, alpha, tau, K, DC, init, tol); subplot(size(u,1)+1,2,1); plot(t,f,'k');grid on; title('VMD分解'); subplot(size(u,1)+1,2,2); plot(freqs,abs(fft(f)),'k');grid on; title('对应频谱'); for i = 2:size(u,1)+1     subplot(size(u,1)+1,2,i*2-1);     plot(t,u(i-1,:),'k');grid on;     subplot(size(u,1)+1,2,i*2);     plot(freqs,abs(fft(u(i-1,:))),'k');grid on; end %---------------run EMD code imf = emd(f); figure; subplot(size(imf,1)+1,2,1); plot(t,f,'k');grid on; title('EMD分解'); subplot(size(imf,1)+1,2,2); plot(freqs,abs(fft(f)),'k');grid on; title('对应频谱'); for i = 2:size(imf,1)+1     subplot(size(imf,1)+1,2,i*2-1);     plot(t,imf(i-1,:),'k');grid on;     subplot(size(imf,1)+1,2,i*2);     plot(freqs,abs(fft(imf(i-1,:))),'k');grid on; end

# 5 麦片

050

0主题 0最佳答案

 请问楼主问题解决了吗，麻烦告知一下
 您需要登录后才可以回帖 登录 | 注册 本版积分规则 回帖后跳转到最后一页