MATLAB: How to divide the signal to AC and DC component.

bandpassfilterfilter and frequency domain and fftfourierfrequencypower_conversion_controlpower_electronics_control

I am newer in DSP. I do not know how to divide the signal to AC and DC component.I use the FFT function to show the Frequency domain. But I still do not know which part of HZ is belong to AC, and which part of HZ is belong DC.Can somebody help me found out them from the image. then give a butter banpass filter code to divide AC and DC part. thank you very munch. The following is my FFT code. and the peak of image should be x=0.2
time = num(:,1); % sampling time
signal = num(:,2); % signal data in Time-Domain
L=length(signal); % Length of signal
Ts = mean(diff(time));
Fs=1/Ts , % sampling frequency
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(signal,NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2+1)
freq = -Fs/2+Fs/NFFT:Fs/NFFT:Fs/2;
Ycent = fftshift(Y);
plot(freq,abs(Ycent));title('Single-Sided Amplitude Spectrum of y(t)');
xlabel('Frequency (Hz)');
ylabel('|Y(f)|');

Best Answer

After you calculate
Y = fft(signal,NFFT)/L;
then Y(1) is the average DC component, and Y(2:end) have to do with the AC components.