The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 sine wave signal generator ?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
fastcloud Posted - 06/20/2013 : 08:50:54 AM
Origin Ver.9 (Student) 64bit
Operating System:Windows7 64bit

Hi, I'm new to this forum!

I'd like to make 1D sine wave signal file with given parameters as;
* shuffle 5 known frequencies every 1 second.
* amplitude fixed to given value (min.~max.)
* sampling frequency at 1500 Hz.
* total length of the data is 5 seconds.

Could any guru help me?

Sanghyun
2   L A T E S T    R E P L I E S    (Newest First)
fastcloud Posted - 06/20/2013 : 8:17:03 PM
Dear Greg;

Your scrip worked great!
I do appreciate your help.

Best regards,

Sanghyun
greg Posted - 06/20/2013 : 4:57:41 PM
Not sure what shuffle is supposed to do.
How about this...

New Project
Copy and Paste the following to the Command Window and press Enter
// BEGIN SCRIPT
// The setup
double dSPS = 1500; // Samples per second
double dSeconds = 5; // Seconds
string strFreq$ = 30 60 120 240 480; // List of frequencies
min = 38; // Minimum
max = 76; // Maximum
// The script
col(1) = data(0,dSeconds,1/dSPS);
get col(1) -e last;
double dFreq;
int tVal;
loop(ii,1,last)
{
tVal = col(1)[ii];
if(tVal == int(tVal) && tVal < 5)
{
// "shuffle"
string strThisFreq$ = strFreq.GetToken(tval+1)$;
dFreq = %(strThisFreq$);
}
col(2)[ii] = sin(2 * pi * dFreq * col(1)[ii]);
}
frange = max - min;
col(2) *= ( frange / 2);
col(2) += ( frange / 2 + min);
// The Plot
plotxy iy:=(1,2) plot:=200;
// The proof
fft1;
win -a Graph2;
// END SCRIPT

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000