No BSD License  

Highlights from
HarmonicSeries.m

3.0

3.0 | 2 ratings Rate this file 8 Downloads (last 30 days) File Size: 6.91 KB File ID: #13420
image thumbnail

HarmonicSeries.m

by Carlos Adrian Vargas Aguilera

 

16 Dec 2006 (Updated 24 Jun 2008)

Space-Time series (1D, 2D, or 3D) as the sum of cosines.

| Watch this File

File Information
Description

Syntax:
    
Z = harmonicseries(AMP, PER, PHA, LEN, DIR, T, X, Y);

Performs the sum of harmonics:
 
z(t,y,x) = sum [ a*cos(k*x + l*y - w*t + theta) ]

where:

a = AMP (amplitude)

k = K*cos(rdir) (x-component of wavenumber vector)

l = K*sin(rdir) (y-component of wavenumber vector)

K = sqrt(k^2+l^2) = (2*pi)./LEN (magnitude of wavenumber vector)

rdir = DIR*(pi/180) (direction of wavenumber vector in radians)

w = (2*pi)./PER (Temporal angular frequency)

theta = PHA*(pi/180) (Initial phase in radians)

This is useful when performing tests of Fourier Spectral Analysis, for example.

The program comes with the example on the screenshot.

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
15 Mar 2007 Michael Morgan

Great, an all-in-one program! I just think the initial phase must be with minus sign and also w instead of k, but great anyway...

12 Jun 2008 Thomas Gall

It is an excessively complex wrapper for a one line statement. This has no purpose except to make your code unreadable and less portable.

21 Jun 2008 Carlos Adrian Vargas Aguilera

I agree "Thomas", I need to clean the code and the inputs arguments. Although, only one person had rated it and it was good. Every comments are well-received (no matter the initial stars) although there's no need to be rude. The program does exactly what I say above and in the help. Next time be contructive. Take a look later for the new submition.

24 Jun 2008 Carlos Adrian Vargas Aguilera

New version. More portable/easy-to-copy.

Please login to add a comment or rating.
Updates
24 Jun 2008

Fixed inputs. Rewritten code.

Tag Activity for this File
Tag Applied By Date/Time
spectral analysis Carlos Adrian Vargas Aguilera 22 Oct 2008 08:52:59
harmonic Carlos Adrian Vargas Aguilera 22 Oct 2008 08:52:59
cosine Carlos Adrian Vargas Aguilera 22 Oct 2008 08:52:59
sine Carlos Adrian Vargas Aguilera 22 Oct 2008 08:52:59
sinusoidal Carlos Adrian Vargas Aguilera 22 Oct 2008 08:52:59
time series Carlos Adrian Vargas Aguilera 22 Oct 2008 08:52:59
fourier Carlos Adrian Vargas Aguilera 22 Oct 2008 08:52:59

Contact us at files@mathworks.com