Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
reconstruct signal after DFT

Subject: reconstruct signal after DFT

From: Kit Mai

Date: 24 Feb, 2012 08:47:21

Message: 1 of 4

Hello everyone,

I am analysizing this signal: S = sin(2*pi*fd*t+23*pi/180) + 0.25*sin(2*pi*3*fd*t+68*pi/180) + 0.3*sin(2*pi*5*fd*t+16*pi/180) + 0.1*sin(2*pi*128*t+78*pi/180) + 0.15*sin(2*pi*243.2*t+94*pi/180) + 0.07*sin(2*pi*376*t);

fd=60.32Hz;
fs=5000Hz;
length of S is 1000

As you can see, in this distorted signal, there are fundamental frequency fd, 3rd, 5th harmonics frequency components, and a few interharmonic components (128, 243.2, 376Hz)

I have successfully used an algorithm to find the best length N of the sampled window for the DFT analysis, which is N=995. This N can minimize the spectrum leakage near the fundamental and harmonics frequency components, as you can see in my plot here:
http://p13.freep.cn/p.aspx?u=v20_p13_photo_1202241632553300_0.png

If the original signal S can be decomposed into S=Sd+Sh+Si
where Sd is fundamental frequency signal, Sh is harmonic signals(only 3rd,5th harmonic in this case) and Si is the interharmonic components signals

Now, my task is to reconstruct the Sd + Sh signal. Due to the lack of knowledge in DSP, I am kindly asking for your suggestions while I am learning it myself.

Should I use the output of FFT? and then zero out the unwanted frequency components, and then do the ifft?

Or should I get the real part and imaginary part of the corresponding coefficients from the output of FFT, and reconstruct the fundamental and harmonic components signal?

Or any other ideas and comment?

Thank you!

Subject: reconstruct signal after DFT

From: Greg Heath

Date: 25 Feb, 2012 19:25:22

Message: 2 of 4

On Feb 24, 3:47 am, "Kit Mai" <maiwei...@hotmail.com> wrote:
> Hello everyone,
>
> I am analysizing this signal: S = sin(2*pi*fd*t+23*pi/180) + 0.25*sin(2*pi*3*fd*t+68*pi/180) + 0.3*sin(2*pi*5*fd*t+16*pi/180) + 0.1*sin(2*pi*128*t+78*pi/180) + 0.15*sin(2*pi*243.2*t+94*pi/180) + 0.07*sin(2*pi*376*t);
>
> fd=60.32Hz;
> fs=5000Hz;
> length of S is 1000
>
> As you can see, in this distorted signal, there are fundamental frequency fd, 3rd, 5th harmonics frequency components, and a few interharmonic components (128, 243.2, 376Hz)
>
> I have successfully used an algorithm to find the best length N of the sampled window for the DFT analysis, which is N=995. This N can minimize the spectrum leakage near the fundamental and harmonics frequency components, as you can see in my plot here:http://p13.freep.cn/p.aspx?u=v20_p13_photo_1202241632553300_0.png
>
> If the original signal S can be decomposed into S=Sd+Sh+Si
> where Sd is fundamental frequency signal, Sh is harmonic signals(only 3rd,5th harmonic in this case) and Si is the interharmonic components signals
>
> Now, my task is to reconstruct the Sd + Sh signal. Due to the lack of knowledge in DSP, I am kindly asking for your suggestions while I am learning it myself.
>
> Should I use the output of FFT? and then zero out the unwanted frequency components, and then do the ifft?
>
> Or should I get the real part and imaginary part of the corresponding coefficients from the output of FFT, and reconstruct the fundamental and harmonic components signal?
>
> Or any other ideas and comment?
>
> Thank you!

Have you thought of removing any spectral components with amplitudes
less than a threshold?

Hope this helps.

Greg

Subject: reconstruct signal after DFT

From: Kit Mai

Date: 29 Feb, 2012 08:00:12

Message: 3 of 4

Greg Heath <g.heath@verizon.net> wrote in message <419ce1cb-c058-4dee-b08b-5df3beeaee42@l14g2000vbe.googlegroups.com>...
> On Feb 24, 3:47 am, "Kit Mai" <maiwei...@hotmail.com> wrote:
> > Hello everyone,
> >
> > I am analysizing this signal: S = sin(2*pi*fd*t+23*pi/180) + 0.25*sin(2*pi*3*fd*t+68*pi/180) + 0.3*sin(2*pi*5*fd*t+16*pi/180) + 0.1*sin(2*pi*128*t+78*pi/180) + 0.15*sin(2*pi*243.2*t+94*pi/180) + 0.07*sin(2*pi*376*t);
> >
> > fd=60.32Hz;
> > fs=5000Hz;
> > length of S is 1000
> >
> > As you can see, in this distorted signal, there are fundamental frequency fd, 3rd, 5th harmonics frequency components, and a few interharmonic components (128, 243.2, 376Hz)
> >
> > I have successfully used an algorithm to find the best length N of the sampled window for the DFT analysis, which is N=995. This N can minimize the spectrum leakage near the fundamental and harmonics frequency components, as you can see in my plot here:http://p13.freep.cn/p.aspx?u=v20_p13_photo_1202241632553300_0.png
> >
> > If the original signal S can be decomposed into S=Sd+Sh+Si
> > where Sd is fundamental frequency signal, Sh is harmonic signals(only 3rd,5th harmonic in this case) and Si is the interharmonic components signals
> >
> > Now, my task is to reconstruct the Sd + Sh signal. Due to the lack of knowledge in DSP, I am kindly asking for your suggestions while I am learning it myself.
> >
> > Should I use the output of FFT? and then zero out the unwanted frequency components, and then do the ifft?
> >
> > Or should I get the real part and imaginary part of the corresponding coefficients from the output of FFT, and reconstruct the fundamental and harmonic components signal?
> >
> > Or any other ideas and comment?
> >
> > Thank you!
>
> Have you thought of removing any spectral components with amplitudes
> less than a threshold?
>
> Hope this helps.
>
> Greg

Dear Greg,

Thank you for replying.

Where does your 'threshold' come from? What should be a good threshold?

I did think of removing some spectral components. I was thinking of keeping the fundamental and harmonic (3rd and 5th) spectral components' DFT coefficients, and making the other coefficients to be zero, and then do the inverse DFT

Kit

Subject: reconstruct signal after DFT

From: TideMan

Date: 29 Feb, 2012 10:14:01

Message: 4 of 4

On Feb 24, 9:47 pm, "Kit Mai" <maiwei...@hotmail.com> wrote:
> Hello everyone,
>
> I am analysizing this signal: S = sin(2*pi*fd*t+23*pi/180) + 0.25*sin(2*pi*3*fd*t+68*pi/180) + 0.3*sin(2*pi*5*fd*t+16*pi/180) + 0.1*sin(2*pi*128*t+78*pi/180) + 0.15*sin(2*pi*243.2*t+94*pi/180) + 0.07*sin(2*pi*376*t);
>
> fd=60.32Hz;
> fs=5000Hz;
> length of S is 1000
>
> As you can see, in this distorted signal, there are fundamental frequency fd, 3rd, 5th harmonics frequency components, and a few interharmonic components (128, 243.2, 376Hz)
>
> I have successfully used an algorithm to find the best length N of the sampled window for the DFT analysis, which is N=995. This N can minimize the spectrum leakage near the fundamental and harmonics frequency components, as you can see in my plot here:http://p13.freep.cn/p.aspx?u=v20_p13_photo_1202241632553300_0.png
>
> If the original signal S can be decomposed into S=Sd+Sh+Si
> where Sd is fundamental frequency signal, Sh is harmonic signals(only 3rd,5th harmonic in this case) and Si is the interharmonic components signals
>
> Now, my task is to reconstruct the Sd + Sh signal. Due to the lack of knowledge in DSP, I am kindly asking for your suggestions while I am learning it myself.
>
> Should I use the output of FFT? and then zero out the unwanted frequency components, and then do the ifft?
>
> Or should I get the real part and imaginary part of the corresponding coefficients from the output of FFT, and reconstruct the fundamental and harmonic components signal?
>
> Or any other ideas and comment?
>
> Thank you!

Since you start with a sum of sines, and you're looking to end with
the real and imaginary parts of those sines, I guess this must be a
purely academic exercise. Otherwise, you could work these out from
the amplitudes and phases without any FFT at all.

But if it were a real problem, where S is a sum of sines with unknown
amplitude and phase but known frequency, then this is not the best way
to go about it.

A better strategy is to solve it in the time domain as a least squares
problem using Matlab's \ facility (help mldivide). This is the way it
is done in the tidal hydraulics toolbox t_tide (Google it).

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us