Extracting a fourier series of pure tones from a signal

In summary, the conversation discusses an error minimization problem where the goal is to solve an equation in order to find the amplitude and phase angle of a pure tone in a given signal. The method of non-linear least squares is suggested as a possible solution, however, there may be better approaches such as linear predictive coding or frequency estimation.
  • #1
tanus5
52
0
I believe this is an error minimization problem so I am trying to solve the following equation

Min((∑ ( (S(t) - A cos(b t + C)))^2 )

Where S(t) is the input signal, t is time and I will sum over t, A is the amplitude, b is radians per second (frequency), and C is the phase angle. I need to solve for A and C so I can subtract the pure tone from the signal, and repeat the function for the next higher frequency.

It is my understanding that to find the minimum I need to find the derivative of (∑((S(t) - A cos(b t + C)))^2 and that presents a problem since the input signal is a set of data and not an actual function so I don't know how to find its derivative. Without the derivative of S(t) I don't believe I can find the derivative of the entire function (∑((S(t) - A cos(b t + C)))^2.

Is this possible to solve, and if so, how?

note: After the fact I realized that I could extract phase angle to a certain degree of error by using a partial derivative holding A=1 and performing these calculations for each possible angle. So for +/- ∏/360 radians (+/- 0.5 degrees) I would need to calculate for all angles 0 <= C < 2∏ and take the minimum from that. I can't do the same for the amplitude since it's domain is infinite. If this can be solved for a known phase angle C, that would also be helpful.
 
Last edited:
Physics news on Phys.org
  • #2
tanus5 said:
It is my understanding that to find the minimum I need to find the derivative of (∑((S(t) - A cos(b t + C)))^2 and that presents a problem since the input signal is a set of data and not an actual function so I don't know how to find its derivative. Without the derivative of S(t) I don't believe I can find the derivative of the entire function (∑((S(t) - A cos(b t + C)))^2.
You are not minimizing with respect to t, but with respect to A and C, for which S(t) is constant. Look up non-linear least squares.
 
  • Like
Likes 1 person
  • #3
DrClaude said:
You are not minimizing with respect to t, but with respect to A and C, for which S(t) is constant. Look up non-linear least squares.

Thanks. I've never heard of non-linear least squares before but it does look like what I'm looking for. I've been doing image processing and noise reduction and am trying to reduce the artifacts that come into play when eliminating high frequencies from an FFT. I suspect a large part of the artifacts are coming from the complex tones so I want to see if I only reduce or eliminate the pure tones if that will provide better noise reduction with less artifacts. The noise I'm dealing with is very regular so I expect it is made up of pure tones so if I can remove only the noise by finding their pure tones I can clean the image. The FFT itself is expensive processing wise, and I expect this is going to be more expensive, but I'm more interested in capability than performance at this point.
 
  • #4
What if I divide each point by the selected frequency with the calculated phase angle and take the average? Will that produce the amplitude with the least error? The way I see it that would basically be re-scaling the space by a cosine and the results at each point would then be an amplitude correct?

Z = A cos(b t + c)
Z/ cos(b t + c) = A

If that is the case than I should be able to use the non-linear least square to more accurately determine the phase angle and with that I can determine the amplitude. Either way I think I'm facing another problem, a signal can contain more than one pure tone at the same frequency and a different phase angle so it seems I will need to repeat this process for each frequency until an amplitude is below a certain cutoff.

Anyhow, I think I see where this is going. If I'm testing 40,000 frequencies and 360 phase angles I end up with 40,000 X 360 items in my Fourier series, or actually 40,000 X 40,000 X 360 considering I'm working in two dimensions. Dropping the high frequencies is trivial since I never need to calculate them in the first place so I should be able to reconstruct the image simply from the pure tones that I'm interested in. This may be worth trying but it isn't computationally sane since a small image could use hundreds of gigabytes simply to store the results.
 
Last edited:
  • #5
DrClaude said:

In practice, this is unlikely to work very well. The reason is that if your estimate of the frequency is wrong by a "large" amount, your estimated sine wave will go in an out of phase with the measured data several times along the length of the data sample. If you sketch a graph of what this looks like, it is fairly clear that the least-squares error will be almost constant, independent of the error in the frequency estimate.

There are better ways. Here are some places to start exploring:
http://en.wikipedia.org/wiki/Linear_predictive_coding
http://en.wikipedia.org/wiki/Pitch_estimation
http://en.wikipedia.org/wiki/Frequency_estimation
 

FAQ: Extracting a fourier series of pure tones from a signal

What is the purpose of extracting a Fourier series of pure tones from a signal?

The purpose of extracting a Fourier series of pure tones from a signal is to break down a complex signal into its individual frequency components. This allows for a better understanding and analysis of the signal, as well as the ability to manipulate and filter specific frequencies if desired.

How is a Fourier series of pure tones extracted from a signal?

A Fourier series is extracted by using a mathematical algorithm called the Fourier transform. This algorithm converts a time domain signal into its frequency domain representation, showing the amplitudes and frequencies of the different tones present in the signal.

What is the difference between a Fourier series and a Fourier transform?

A Fourier series is a representation of a signal in terms of sinusoidal functions, while a Fourier transform is a mathematical algorithm used to convert a signal from the time domain to the frequency domain. The Fourier series is a specific case of the Fourier transform, used for signals that are periodic in nature.

Can a Fourier series accurately represent any signal?

No, a Fourier series can accurately represent signals that are periodic and have a finite number of frequency components. Non-periodic signals or signals with an infinite number of frequency components cannot be accurately represented by a Fourier series.

How is a Fourier series used in practical applications?

A Fourier series is used in various fields such as signal processing, audio and image compression, and analysis of periodic data. It also has applications in physics, engineering, and mathematics for solving differential equations and studying periodic phenomena.

Similar threads

Replies
7
Views
1K
Replies
47
Views
3K
Replies
3
Views
1K
Replies
11
Views
1K
Replies
1
Views
2K
Back
Top