- #1

- 169

- 4

(The signal is sin(x)+2*sin (2x) +3*cos (3x)+4*cos (4x) +5 =f (x), of course normally i don't have the function i have points (x,f (x)) .)

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- Thread starter abdo799
- Start date

In summary: If he fits an order n-1 polynomial to n data points, then convert the coefficients to the integral, he will still have to eliminate the DC.

- #1

- 169

- 4

(The signal is sin(x)+2*sin (2x) +3*cos (3x)+4*cos (4x) +5 =f (x), of course normally i don't have the function i have points (x,f (x)) .)

Engineering news on Phys.org

- #2

Staff Emeritus

- 11,308

- 8,730

- #3

- 169

- 4

Yes it would work but i can't because i don't have the full cycle so i can't get its averageanorlunda said:

- #4

Mentor

- 66,665

- 19,214

- #5

Science Advisor

2023 Award

- 14,104

- 8,042

Take the Fourier transform, FFT, of the signal. Overwrite the Cosine( zero ) component with zero. Take the IFT. The DC is gone!abdo799 said:Is there any algorithm or method that can remove the dc component using only a half cycle?

Or; write a digital high-pass filter to eliminate the low frequencies.

- #6

- 169

- 4

Sorry for the late reply, i am asking for a friend so i had to get back to him, he said " he has a half cycle of the function not just the x or the 4x , he can't get a full cycle because the period is very long he doesn't have time to get a full cycle ( it's some kind of mechanical application, vibration or something, didnt really understand because i am electrical major :) )berkeman said:

As for the snr he's trying to figure it out right now as an ideal situation, once he figures it out he will start dealing with the noise from the sensors and the adc etc..

- #7

Mentor

- 66,665

- 19,214

I meant the frequencies of the sin() and cos() parts of the function. The periods are different when the arguments are x, 2x, 3x, 4x. Presumably he means only a half-cycle of the slowest-varying argument to the functions, which would be just x.abdo799 said:The signal is sin(x)+2*sin (2x) +3*cos (3x)+4*cos (4x) +5 =f (x),

I'll try plotting that with Excel or Wolfram Alpha when I get a chance to see what it looks like...

- #8

- 169

- 4

Doesnt fft require an integer number of cycles sampled?Baluncore said:Take the Fourier transform, FFT, of the signal. Overwrite the Cosine( zero ) component with zero. Take the IFT. The DC is gone!

Or; write a digital high-pass filter to eliminate the low frequencies.

As for the filters, he tried on MATLAB to multiply by this transfer function ( (1-z)/(1-0.95z)) he read somewhere online that this T.F blocks dc , then he set the simulation to end after half the period and it didnt work.

- #9

- 169

- 4

But when he used numerical integration methods (because he doesn't have the function he has points) he got the right graph but there is a dc offset , he wants to remove it to get the right graph

- #10

Science Advisor

2023 Award

- 14,104

- 8,042

Not necessarily. Apply a raised cosine window function before the transform to reduce the sensitivity. If he has exactly one half cycle of the fundamental, there are ways to extend the data by adding samples with value zero, or by duplication, inversion or folding.abdo799 said:Doesnt fft require an integer number of cycles sampled?

If he fits an order n-1 polynomial to n data points, then convert the coefficients to the integral, he will still have to eliminate the DC.

The constant 5 in the generator equation and the constant of integration will be combined. It will be impossible to separate the estimates of the integral of the constant +5 term and the constant of integration. I guess the problem depends on how the “DC offset” is defined. If he can see a DC offset, why can he not remove it?

- #11

- 169

- 4

i didnt really understand what you said about the polynomilas, can you explain more please, if you don't mind.Baluncore said:Not necessarily. Apply a raised cosine window function before the transform to reduce the sensitivity. If he has exactly one half cycle of the fundamental, there are ways to extend the data by adding samples with value zero, or by duplication, inversion or folding.

If he fits an order n-1 polynomial to n data points, then convert the coefficients to the integral, he will still have to eliminate the DC.

The constant 5 in the generator equation and the constant of integration will be combined. It will be impossible to separate the estimates of the integral of the constant +5 term and the constant of integration. I guess the problem depends on how the “DC offset” is defined. If he can see a DC offset, why can he not remove it?

about duplication ... he can't do that because there is no half wave symmetry ( the real function is actually longer than what i wrote , i just tried to give a simplified example) about

i don't understand how it will help, can you please explain further?Baluncore said:adding samples with value zero

- #12

Science Advisor

2023 Award

- 14,104

- 8,042

Do you remember the quick way to differentiate a polynomial?abdo799 said:i didnt really understand what you said about the polynomilas, can you explain more please, if you don't mind.

Say you have a polynomial y = a + bx + cx^2 + dx^3 + …

You know the derivative will be y' = b + 2cx + 3dx^2 + …

Reversing that process, you can generate the integral of the polynomial; y = a + bx + cx^2 + dx^3 + …

as; Integral( y ) = k + ax + (bx/2)^2 + (cx/3)^3 + (dx/4)^4 + … ; where k is the constant of integration.

You just need to be able to convert the n sample points to n-1 polynomial coefficients.

If I remember correctly, the same sort of trick can be done with Fourier coefficients after an FFT.

Swap the Cos() and Sin() coefficients, negate as needed.

If you have less than 2^n points you can follow it with zeros to make it up to 2^n points for a FFT.abdo799 said:i don't understand how it will help, can you please explain further?

If you have exactly half a cycle of fundamental, repeating the data, but negative, will complete the fundamental cycle. It may cancel or double the other coefficients.

- #13

- 169

- 4

So for example if i have a signal with period 6 s and i am taking a sample every 1 sBaluncore said:If you have exactly half a cycle of fundamental, repeating the data, but negative, will complete the fundamental cycle. It may cancel or double the other coefficients.

Lets say

0 1

1 3

2 4

3 2

If i assumed that

4 -3

5 -4

6 -2

The fundemetal component should be the same but other coefficient will be changed?

- #14

Science Advisor

2023 Award

- 14,104

- 8,042

That looks OK, except for the confusing entry; 0 1.

- #15

- 169

- 4

I got confused too when i was typing the reply , i will tell him to try it.Baluncore said:That looks OK, except for the confusing entry; 0 1.

Will parameter estimators ( like maximum likelyhood for example ) work?

- #16

Science Advisor

2023 Award

- 14,104

- 8,042

When folding data, keep your wits about you.abdo799 said:I got confused too when i was typing the reply , i will tell him to try it.

I have no idea. Every method leads to the correct result, only the error bars are different. If you know what you are looking for in the data you will find it, but is it really there, or is it just some lucky noise.abdo799 said:Will parameter estimators ( like maximum likelyhood for example ) work?

Working through an intermediary or translator can lead to misunderstandings. The incomplete example equation given is not what I would expect in the real world. In the situation where the fundamental is smaller than the harmonics, I would expect stored energy, instability or a chaotic surprise.

All we can do here is throw in suggestions of different possible approaches. Education involves understanding possible solutions well enough, to reject them for valid reasons.

If you are using Fourier coefficients then maybe the problem is cyclic. Make the number of samples per cycle a count of 2^n so as to benefit from the FFT. Use many samples for the highest frequency present, not the requisite Nyquist 2, but an absolute minimum of 16. That way, resolution will be sufficient to keep the expected harmonics separate while still using a window function.

Last edited:

The purpose of this research is to develop algorithms that can efficiently estimate the DC component of a signal that has been sampled at half-cycle intervals. This is important in applications such as power systems monitoring, where accurate estimation of the DC component is crucial.

Half-cycle sampling is a technique used to reduce the amount of data required for signal processing, while still maintaining the same level of accuracy. This is particularly useful in power systems monitoring, where large amounts of data are generated and need to be processed in real-time.

These algorithms use a combination of mathematical techniques, such as Fourier series and least squares estimation, to achieve a more accurate and efficient estimation of the DC component compared to traditional methods. They also have the advantage of being computationally efficient, making them suitable for real-time applications.

One of the main challenges was finding a balance between accuracy and computational efficiency. We also had to carefully consider how to handle noise and other disturbances in the signal, as they can greatly affect the accuracy of the DC estimation.

These algorithms can be applied in various practical settings, such as power systems monitoring, audio signal processing, and biomedical signal processing. They can help improve the accuracy and efficiency of DC estimation, which is important in applications where real-time monitoring and control is necessary.

Share:

- Replies
- 48

- Views
- 1K

- Replies
- 16

- Views
- 887

- Replies
- 14

- Views
- 1K

- Replies
- 2

- Views
- 203

- Replies
- 5

- Views
- 195

- Replies
- 22

- Views
- 279

- Replies
- 1

- Views
- 538

- Replies
- 12

- Views
- 1K

- Replies
- 12

- Views
- 1K

- Replies
- 8

- Views
- 979