MATLAB: How to perform FFT on this signal and frequency domain

frequency domain

t = (0:0.001:1); x = 110*sin(2*pi*50*t); y = 10*sin(2*pi*250*t); z=x+y; plot(z)

Best Answer

  • Try this:
    [pxx1,f1] = pwelch(y1,512,66.7,[],1000);
    [pxx2,f2] = pwelch(y2,512,66.7,[],1000);
    figure(1);
    semilogx(f1,pxx1);xlabel('Frequency(Hz)');title('2*pi*50*t');
    figure(2);
    semilogx(f2,pxx2);xlabel('Frequency(Hz)');title('2*pi*250*t');
    You will see each signal's frequency domain plot, which has peaks at 50 and 250 Hz respectively.