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 |
|
|