Gratis å bruke, uten konto

Kalkulator for Fourier-rekker

Beregn en reell Fourier-rekke fra jevnt fordelte målinger over én periode. Velg hvor mange harmoniske ledd som skal beholdes, undersøk koeffisientene og sammenlign den rekonstruerte kurven med målingene.

Oppgi 4–128 jevnt fordelte prøveverdier, én per linje eller atskilt med semikolon. Ikke gjenta endepunktet.

Bruk én konsekvent tidsenhet. Frekvensen er den omvendte verdien av perioden og vises per tidsenhet.

Grensen avhenger av antall prøver, slik at det brukbare frekvensområdet ikke overskrides.

Dette er en tilnærming med et begrenset antall prøver, ikke en lydanalysator. Flere prøver og harmoniske komponenter kan gi bedre tilpasning for glatte signaler; diskontinuiteter kan gi Gibbs-oversving. Resultatet forutsetter jevne prøver og én riktig valgt periode.

Reell Fourier-rekke: DC = (1/N)Σxⱼ; aₙ = (2/N)Σxⱼcos(2πnj/N); bₙ = (2/N)Σxⱼsin(2πnj/N); f(t) = DC + Σ[aₙcos(2πnt/T) + bₙsin(2πnt/T)], 0 ≤ t < T.

Hvordan fungerer Fourier-rekkekalkulatoren?

Oppgi 4–128 jevnt fordelte verdier for én komplett periode, periodens lengde og antall harmoniske komponenter. Kalkulatoren anslår reelle Fourier-koeffisienter med en diskret sum og rekonstruerer signalet fra valgte harmoniske komponenter.

Veiledning

Slik bruker du Kalkulator for Fourier-rekker

The Fourier Series Calculator takes equally spaced samples from one period of a signal and estimates its real Fourier series. It reports the average (DC) value, the fundamental frequency, and a cosine, sine and amplitude figure for each harmonic you keep, and draws the rebuilt curve against your samples. It is a finite-sample estimate for study, not an audio analyzer.

Slik gjør du

  1. Type 4 to 128 sample values for exactly one period, one per line or separated by semicolons. Do not repeat the first value at the end.
  2. Enter the period length in any consistent unit. The tool shows frequency as the inverse of that period.
  3. Choose the highest harmonic to include. The limit depends on how many samples you gave.
  4. Press Calculate series to see the table and the chart. Load sine example or Load constant example fill the form for you.

Eksempler

One cycle of a sine wave

Du skriver inn
Målinger
0 1 0 -1
Periode
1
Harmoniske
1
Du får
DC-verdi
0
Frekvens
1
Harmonisk 1
Cosinuskoeffisient: 0; Sinuskoeffisient: 1; Amplitude: 1
RMS-feil
0

The four samples sit on a sine wave of height 1, so all of the signal lands in the sine coefficient of harmonic 1 and the rebuilt curve matches the samples exactly.

Kjørt med verktøyets egen kode.

A square wave from eight samples

Du skriver inn
Målinger
1 1 1 1 -1 -1 -1 -1
Periode
1
Harmoniske
3
Du får
DC-verdi
0
Harmonisk 1
Cosinuskoeffisient: 0.5; Sinuskoeffisient: 1.2071068; Amplitude: 1.306563
Harmonisk 2
Cosinuskoeffisient: 0; Sinuskoeffisient: 0; Amplitude: 0
Harmonisk 3
Cosinuskoeffisient: 0.5; Sinuskoeffisient: 0.2071068; Amplitude: 0.5411961
RMS-feil
0
Kurvetopp
about 1.3115

Only odd harmonics carry energy here. The rebuilt curve passes through all eight samples, yet between them it rises to about 1.3115, higher than any sample. This is the kind of overshoot that appears near a jump.

Kjørt med verktøyets egen kode.

A short shape with a different period

Du skriver inn
Målinger
2 4 6 4
Periode
0.5
Harmoniske
1
Du får
DC-verdi
4
Frekvens
2
Harmonisk 1
Cosinuskoeffisient: -2; Sinuskoeffisient: 0; Amplitude: 2
RMS-feil
0

The average of 2, 4, 6 and 4 is 4. A period of 0.5 gives a fundamental frequency of 1 divided by 0.5, which is 2 per time unit. The cosine term is minus 2 because the samples are lowest at the start.

Kjørt med verktøyets egen kode.

A constant signal

Du skriver inn
Målinger
3 3 3 3
Periode
2
Harmoniske
1
Du får
DC-verdi
3
Frekvens
0.5
Harmonisk 1
Cosinuskoeffisient: 0; Sinuskoeffisient: 0; Amplitude: 0

With no change from sample to sample, the average is the whole signal and every harmonic is zero, apart from rounding noise that the tool sets to zero.

Kjørt med verktøyets egen kode.

Når det er nyttig

  • Check a hand calculation of Fourier coefficients for a signals or maths course.
  • See which harmonics a periodic waveform is built from.
  • Watch how adding harmonics changes the rebuilt curve against the samples.
  • Get the average value and fundamental frequency of one recorded cycle.

Begrensninger

  • Between 4 and 128 samples, evenly spaced, covering exactly one period. The period must be positive, and values stay under 1e12 in size.
  • The highest harmonic allowed is the sample count minus one, halved and rounded down (3 for 8 samples), so the term at exactly half the sampling rate is left out.
  • A truncated series can overshoot near a sudden jump, so the curve may rise above your data. More harmonics narrow the effect but do not remove it.
  • The answer depends on picking one true period and sampling it evenly. It is not an audio or vibration analyzer, and there is no windowing.

Tips

  • Start with a simple wave such as a sine to learn how a, b and the amplitude relate before you try your own data.
  • If the first and last sample would be the same point of the cycle, leave the last one out.
  • Compare the RMS error across harmonic counts; a small value means the rebuilt curve fits the samples well.

Kilder

Vanlige spørsmål

How does this Fourier series calculator work?

It reads your samples as one period, finds the average, then sums each sample against cosine and sine waves of each harmonic to get a and b. The curve is rebuilt from the average plus those harmonics and compared with your samples.

What does the DC value mean?

It is the average of all the samples in the period. A signal that never changes has only a DC value. Shifting the whole signal up by 1 changes the DC value by 1 and leaves the other coefficients unchanged.

How do I read the a and b numbers?

The a value is the weight of the cosine wave at that harmonic and b is the weight of the sine wave. The amplitude is the square root of a squared plus b squared, which is the size of that harmonic regardless of its timing.

Why is the harmonic limit lower than the number of samples?

Samples can only describe frequencies up to half their rate. With 8 samples the highest harmonic allowed is 3, and with 4 samples it is 1. Asking for more would create false patterns.

Why does the curve overshoot near a jump?

A sum of smooth waves cannot follow a sudden step cleanly and swings past it. This is called the Gibbs phenomenon. Adding harmonics narrows the ringing region but does not remove the overshoot entirely.

Should the last sample repeat the first one?

No. The samples describe one full period starting at time 0, and the next period begins where the list ends. Repeating the first value at the end would count that point twice and distort the coefficients.

What time unit should I use?

Any one you like, as long as it is consistent. The tool only inverts your period to give a frequency, so a period in seconds gives hertz and a period in hours gives cycles per hour.

Hvordan fungerer Fourier-rekkekalkulatoren?

Oppgi 4–128 jevnt fordelte verdier for én komplett periode, periodens lengde og antall harmoniske komponenter. Kalkulatoren anslår reelle Fourier-koeffisienter med en diskret sum og rekonstruerer signalet fra valgte harmoniske komponenter.

Lastes målingene mine opp?

Nei. Beregningen og diagrammet kjøres i nettleseren. Målingene dine lastes ikke opp eller lagres av verktøyet.

Hva betyr DC-komponenten?

Den er gjennomsnittsverdien av alle prøvene i én periode. Et konstant inngangssignal har derfor bare en DC-komponent, mens alle høyere koeffisienter er null innenfor avrundingstoleransen.

Hvor mange prøver og harmoniske komponenter bør jeg bruke?

Bruk nok jevnt fordelte prøver til å beskrive bølgeformen. Kalkulatoren begrenser antall harmoniske komponenter til det brukbare området for disse prøvene; flere komponenter kan fange skarpere endringer, men kan gi oversving nær sprang.

Hvorfor kan den rekonstruerte kurven overskyte nær et sprang?

En avkortet Fourier-rekke kan vise Gibbs-svingninger rundt en diskontinuitet. Flere harmoniske komponenter gjør området som påvirkes, smalere, men fjerner ikke oversvinget helt.