MATLAB: Digital signal related question(fft,pspectrum)

dspfftpspectrum

Hi
I have a dsp related question but i dont know if this is the right place to ask it.
I have real life measurements from a device in timedomain with a length of approximatley 14-15seconds. During this time the device was off and after a couple of seconds turned on. I use the function pspectrum in matlab to plot the spectrogram of this signal wich hive me this:
The first two seconds the device was off, between 2 and 4 seconds you see the start-up transients and after 4 seonds we are in steady state. Clearly we can see a component on 200Hz and 400Hz. If i plot the spectrum amplitude-frequency domain at timepoint 8seconds i get the following spectrum:
The top spectrum is when the device is turned off and the bottom spectrum is when the device is in steady state. So even here you can see the components on 200Hz and 400Hz showing up. So i am interested in these components. But this is where my problem comes. What i want is to extract the amplitude AND the phase of those components. unfortunately the function pspectrum cant calculate the phase of the components, so this is my idea.
I know that after 4seconds these 2 components are always in the signal. If i use the fft function over the whole time domain signal i will have amplitude loss because for the first 4 seconds the components are'nt in the signal. So i extract the time domain signal from 13seconds to 14 seconds(because the amplitude is the highest in this time slot) so i have a time domain signal of 1 second. For this time domain signal i use a the function fft in matlab so i can calculate the amplitude and phase of the components. I expect the same amplitude-frequency plot like that from the figure above, but instead when using regular fft over 1 second of data i get following spectrum.
As you can see when calculating the spectrum using regular fft i expected to see a dominant frequency at 200Hz and a smaller one on 400Hz but instead i get a whole lot more components that are dominant in the spectrum. As i dont have enough expercience with dsp i dont quite know how this comes. Is there anyone who can help me with this or explain how this comes?
I appreciate any kind of help
Thanks in advance

Best Answer

If you only want to isolate those two frequencies, use the bandpass function to design filters for each frequency. (That group of functions were introduced in R2018a. If you have an earlier version, bandpass filters are straightforward to design in MATLAB. I will help you design them, if you want.)
Related Question