www.coware.com

4

Using the Signal Calculator


Introduction

This chapter is an introduction to editing signals with the Signal Calculator (SigCalc). The chapter lessons explain how you create, display, select, edit, and save signal files. At the end of the chapter, you create a signal file that is used in the simulation of the notch60 test system.

Invoking SigCalc

  1. In the File Manager window, click on the SigCalc icon.
  2. This displays the SigCalc window.

  3. In the SigCalc window, execute the following command:
  4. File-Open-Signals From Disk 
     

    This displays a list of SPW data libraries.

  5. Scroll down the list and double-click on "test_lib/."
  6. This changes the list box to show the signal files within the selected library.

  7. Double-click on the file name mary.sig.
  8. This displays the signal file test_lib/mary.sig as a waveform.

    The SigCalc window should look similar to the one shown in Figure 4-1.

Note: Your SigCalc window might look somewhat different from the one shown in the figure because of the display option settings that are carried over from session to session. If you do not see the calculator keypad, click on the Calc button to display it.

Figure 4-1  Signal Calculator Window

SigCalc Window Features

The SigCalc window has two main sections: the calculator and the signal display area. The calculator works just like an ordinary pocket calculator, except that it performs calculations on signals as well as numbers.

The signal display area shows a set of signals. The signals can come from signal files stored on disk, from the TMP signal window in the calculator, or from the signal generation commands of SigCalc.

Generating Signals

On the left side of the SigCalc window is a palette of command icons for generating and analyzing signals. Each icon performs the same function as the corresponding pull-down menu command, as indicated in Figure 4-2.

Figure 4-2  Command Icon Palette

Note: Additional icons may be present, depending on whether certain optional add-on products are installed.

  1. Click on the Gen-Sine icon in the palette.
  2. This displays the dialog box shown in Figure 4-3.

Figure 4-3  Gen-Sine Dialog Box

  1. To use the default settings, click on the OK button.
  2. The new signal is generated and displayed. It is inserted at the top, above the signal "mary.sig."

  3. Click on the Gen-Square icon to display the Generate Square Wave dialog box.
  4. Change the Number of Points value to 8000. Leave the other settings at their default values.
  5. Click on the OK button, and the square wave is generated and inserted at the top.
  6. Click on the S3 button in the signal display frame for the mary.sig signal. This selects signal S3 and places a copy in the TMP window of the calculator, as shown in Figure 4-4.
Figure 4-4  SigCalc Window Features

Generating More Signals

You do not need the calculator now, so you can remove it to make more room for signals.

  1. Click on the Calc button to remove the calculator.
  2. For now, you also do not need the original signal, called mary.sig. That signal is designated S3 and is currently selected.

  3. To remove the selected signal from the signal display area, press and hold the right mouse button and select the following command:
  4. Edit-Cut 
    

Generate a Triangle Signal

  1. Click on the Gen-Triangle icon to display its dialog box.
  2. Change the value of the Number of Points field to 1000.
  3. Leave the other field settings at their default values.

  4. Click on the OK button, and the triangle wave is generated.

Generate a Sawtooth Signal

  1. Click on the Gen-Sawtooth icon to display its dialog box.
  2. Change the value of the Amplitude field to 7.0 and the value of the Sampling Frequency field to 2.0.
  3. Leave the other field settings at their default values.

  4. Click on the OK button, and the sawtooth wave is generated.

Generate a Phasor Signal

  1. Click on the Gen-Phasor icon to display its dialog box.
  2. Change the value of the Frequency field to 0.005.
  3. Leave the other field settings at their default values.

  4. Click on the OK button, and the complex phasor signal is generated.
  5. The phasor has real and imaginary components, which are displayed separately.

Generate a White Gaussian Noise Signal

  1. Double-click on the WGN (White Gaussian Noise) icon, and a white noise signal is generated.
  2. By double-clicking, you bypass the dialog box and use the default settings.

The signals are displayed in order, starting with the most recently created signal at the top of the signal display area, as shown in Figure 4-5.

Figure 4-5  Signal Display Area

Signal Display Area Features

The signal display area contains multiple signal windows, sequentially labeled S1, S2, S3, and so on. A signal waveform is made up of discrete data points connected by line segments. The horizontal axis marks the number of samples, while the vertical axis marks the amplitude. The vertical axis is marked with the most extreme values of the current scale on the left side of the signal window.

By default, all signal windows show the same range and number of data points. However, a lengthy signal plot might not fit within the window width, and a shorter signal plot might not completely fill a window. When a signal does not have enough data points to fill a signal window, the unused space is filled with null points displayed as cross-hatching on the horizontal axis. The total number of signal windows changes as you add signals to and cut signals from the SigCalc window.

Text fields at the top of the signal display area provide data about signal windows, signal selections, and target designations.

Signal Cursor

In the default operating mode, a single signal cursor moves as a unit, marking the same point number in all signal windows. Initially, the signal cursor rests at the left edge of the signal windows, crossing the first data point. The signal data fields (Point#, Time, and Value) provide information about the data point marked by the cursor and change automatically in response to signal cursor movements.

Move the Signal Cursor

Move the signal cursor as follows:

  1. Point inside any signal window.
  2. Press and hold the middle mouse button, drag the signal cursor to the right, and release the mouse button.
  3. Press the left or right keyboard cursor arrow key, and the cursor moves one point at a time.

Text Fields

Text fields to the right of each signal window display information on the adjacent signal waveform. The data fields are explained in Table 4-1.

Table 4-1  Signal Window Text Fields

Table 0-1
Text Field
Explanation
File name
Signal's file name, if any, in the form of library/name.
Type
Signal data type: Double, Integer, Float, and so on.
Samp. Freq.
Signal's sampling frequency (number of points per second).
# Pts
Signal's total number of points.
Point#
Point number marked by the signal cursor.
Time
Point in time marked by the signal cursor.
Value
Amplitude value of the point marked by the signal cursor.

Edit Signal Window Text Fields

You can edit these text fields to set the signal characteristics (except for the Type field).

To edit the Point# field:

  1. Click on the value in the Point# field to the right of the sawtooth wave signal window (S3).
  2. The Set Signal Point dialog box is displayed.

  3. In the dialog box, change the value of the Point# field to 500 and click on the OK button.
  4. The signal cursor moves to point number 500.

Adjusting the Horizontal Scale and View

All the signal windows show the same range of points. You can control the point range by editing the Win Size (window size), Win# (window number), and Shift (shift value) fields, located just above the top signal window.

Changing the Window Size

The Win Size value is the number of points plotted in each signal window. If it is not already set to 1000, set it to that value:

  1. Point to the Win Size text field and click.
  2. A temporary input field is displayed.

  3. Edit the input field to read 1000 and then press the Return key to implement the change.

Changing the Window Number

Signal plots are divided into sections, each section equal to the window width (now set to 1000). The Win# text field shows which section is on display.

  1. Point to the Win# text field and click.
  2. A temporary input field is displayed.

  3. Edit the Win# text field, change the value from 0 to 1, and press the Return key.
  4. Points 1,000 through 1,999 are displayed.

Changing the Shift Value

The Shift value indicates the point or time value by which a signal plot is offset with respect to a full plot segment or window width display. You can change this value so that portions of two consecutive windows are displayed rather than one whole section.

  1. Point to the Shift text field and click.
  2. A temporary input field is displayed.

  3. Edit the Shift field, change the value from 0 to 500, and press the Return key.
  4. The signal window shows points 500 through 1,499.

  5. There is a scroll bar at the bottom of the signal display area. Move the scroll bar slider all the way to the left.
  6. This returns the view to points 0 through 999.

Selecting Signals

To edit a signal, you must first select a range of data points. The selected points are highlighted in the signal window with a distinct background color. The selection range can be as small as a single data point or as long as an entire signal.

Selecting a Whole Signal

To select a whole signal, use the following procedure:

  1. Click on the Calc button to display the calculator palette and TMP signal window.
  2. Click on the S1 button to select signal S1, the WGN signal.
  3. The whole signal waveform is highlighted, and a highlighting rectangle is displayed around the signal window, showing that the whole signal is selected. Your selection is also displayed in the TMP window.

  4. Point anywhere on the S3 (sawtooth) signal waveform and double-click.
  5. The whole signal is selected, just as if you had clicked on the S3 button. The previous selection is canceled

  6. Point to the empty area just to the right of the S1 button and click once.
  7. This empty space is a "null" area in the signal display frame. When you click on it, your previous selection is canceled and nothing is selected.

Selecting a Range of Points

  1. Point to any data point in the S1 (WGN) waveform.
  2. Click on the signal waveform without dragging the mouse.
  3. A single point is selected.

  4. Press and hold the left mouse button, drag the mouse to the right, and release the mouse button.
  5. The range over which you drag the mouse is selected, and only that section is highlighted. There is no highlight rectangle around the signal window because only part of the signal is selected.

Using the Select-Range Command

When you need to select a range of points with greater precision, use the Select-Range command.

  1. Select all of signal S1.
  2. Execute the following command:
  3. Select-Select Range 
     

    This command displays the dialog box shown in Figure 4-6.

Figure 4-6  Signal Selection Dialog Box

  1. In the dialog box, enable the Range button.
  2. This activates the Point Min and Point Max fields.

  3. Edit the input field of the Point Min field to read 100. Edit the input field for the Point Max field to read 299. Leave other settings as is.
  4. Click on the OK button.
  5. Points 100 through 299 are selected for signal S1.

Selecting Multiple Signals and Data Ranges

You can select multiple signals or signal ranges.

  1. Hold down the Control key and select any three signals.
  2. Each new selection is added to the previous selection. Only the first selected signal is displayed in the TMP signal window.

  3. Point to a null area and click to cancel the selection.
  4. Hold down the Control key and use the mouse to select some signal ranges repeatedly within S1.
  5. With the Control key pressed, selection works as a toggle: unselected points in the previous selection become selected, and vice versa.

  6. Point to a null area and click to cancel the selection.
  7. Hold down the Shift key and use the mouse to select a signal range repeatedly within S1.
  8. Using the Shift key extends the current selection. When you press the mouse button to select, SigCalc looks for the nearest point in the same signal that is already selected. All points from that point to the mouse pointer location are selected automatically.

  9. Point to a null area and click to cancel the selection.

Selection Field

A selection indicator field ("Select=") is displayed at the top of the SigCalc window. It shows the current selection in text format. The examples in Table 4-2 illustrate the syntax used to describe the current selection.

Table 4-2  Selection Indicator Syntax and Explanations

Table 0-2
Text in Select= Field
Selection
S1
All of Signal S1
S1[100,199]
Signal S1, points 100 through 199
S1[100]
Signal S1, point 100 only
S2.real[20,29]
Complex Signal S2, real component only, points 20 through 29
S2.imag[20,29]
Complex Signal S2, imaginary component only, points 20 through 29
S2[20,29]
Complex Signal S2, both components, points 20 through 29
S1,S2
Multiple selection, signals S1 and S2

  1. Try selecting various signals and signal ranges and observe the effects on the Select= field.
  2. Click on the text in the Select= field, type in a new signal and/or point range, and press the Return key. The selection is modified and the signal display window is updated to show the new selection.

Adjusting the Vertical Scale and View

The vertical (amplitude) scale of a signal window is automatically adjusted each time the signal is redrawn in order to accommodate the signal's most extreme values in the viewing range.You can override the default scale by using the View-Scale commands.

Scale Override

  1. Select the whole S3 (sawtooth) signal.
  2. Execute the following command:
  3. View-Change Scale-Override 
     

    The dialog box shown in Figure 4-7 is displayed.

Figure 4-7  Override Scale Dialog Box

  1. Edit the High Axis Value field to read 5.0 and the Low Axis Value field to read 0.0.
  2. Click on the OK button.
  3. The scale of the window is changed to the specified maximum and minimum values. Now the most extreme values (maximum and minimum) of the sawtooth signal are hidden.

Auto Scale

  1. With the S3 signal still selected, execute the following command:
  2. View-Change Scale-Auto Scale 
     

    The ends of the scale are adjusted to accommodate the most extreme values of the signal, -7 and +7.

  3. With the S3 signal still selected, hold down the Control key and select S1 and S2).
  4. With S1, S2, and S3 all selected, execute the following command:
  5. View-Change Scale-Override 
    
  6. Click on the OK button in the dialog box.
  7. The change is applied to all the selected signals.

Scope Scale

  1. With the S1, S2, and S3 signals still selected, execute the following command:
  2. View-Change Scale-Scope Scale 
     

    In the Scope Scale mode, the minimum and maximum values are set to round values, like an oscilloscope's voltage range selections: ...1, 2, 5, 10, 20, 50, and so on. The smallest round value that accommodates the entire signal is used at the positive and negative ends of the scale.

  3. Point to a null area and click to cancel the selection.
  4. Click on the Calc button to remove the calculator.

Designating a Target

The Target Marker is a triangular arrow on the left side of the signal display area. The Target Marker is shown in Figure 4-8. When you generate a new signal or perform an operation that creates a new signal, it is added to the SigCalc window at the point designated by the Target Marker.

Figure 4-8  Target Marker and Related Items

Using the Target Marker

Use the Target Marker by following these steps:

  1. Point to the bottom of the target bar, below the Target Marker.
  2. Click the left mouse button a few times.
  3. The Target Marker moves down one step at a time.

  4. Click a few times above the Target Marker.
  5. The Target Marker moves up one step at a time.

  6. Click the middle mouse button, and the Target Marker jumps immediately to the mouse pointer.

The Target Marker always stops at the middle of each signal window and at each border between signal windows. A colored highlight border visually defines the target.

If the target is a signal plot, the highlight border surrounds the entire signal display frame. If the target is a border between two signal display frames, the target border is highlighted.

When the Target Marker points to a border, an editing command inserts a new signal at that point, creating a new signal window, and signals below the target point are pushed down and renumbered.

When the Target Marker points to the middle of an existing signal window, the new signal is inserted into that window. The manner in which the insertion takes place depends on the target mode, which you set with the Target Mode option button at the top of the signal display area. The current setting is displayed on the button, which initially is Replace.

For a complex signal, the marker can point to the border between the two components, which designates the whole signal as the target, or it can point to one component only, which designates only that component as the target.

Changing the Target Mode

To change the target mode, follow these steps:

  1. Click on the Win Size field and change the window size to 2000.
  2. Make the Target Marker point to the center of signal S1.
  3. Point to the Target Mode option button (shown in Figure 4-8).
  4. Press and hold the mouse button, select the option [Insert] from the menu, and then release the mouse button.
  5. The Target Marker changes in appearance to indicate the Insert mode.

  6. Double-click on the Gen-Triangle button.
  7. This generates a triangle wave and inserts it into signal window S1, pushing the existing signal to the right.

  8. Set the target mode back to the default setting, Replace.
  9. Double-click on the Gen-Triangle button again.
  10. This generates a triangle wave and inserts it into signal window S1, replacing the existing signal.

  11. Place the Target Marker at the top of the Target Bar, above S1 (the default position).

The four target operating modes are summarized in Table 4-3.

Table 4-3  Target Modes
Mode
Application
Replace
The entire target signal is removed and replaced with the new signal. The original target signal is discarded.
Insert
The new signal is inserted at the beginning of the target signal. The original points are pushed to the right, increasing the signal's total length.
Repl. At Cursor
The points of the new signal replace those in the target signal, starting at the point marked by the signal cursor. The length of the signal generally remains unchanged.
Ins. At Cursor
The new signal is inserted in the target signal, starting at the point marked by the signal cursor. The original points to the right of the cursor are pushed further to the right, increasing the signal's total length.

Using Cut, Copy, and Paste

Use the Edit-Cut, Edit-Copy, and Edit-Paste commands to cut a section from a signal, or to copy part or all of a signal from one place to another. The following exercises demonstrate the use of these commands.

Cutting and Pasting

  1. Click on the S2 button to select the whole complex phasor signal.
  2. Execute the following command:
  3. Edit-Cut 
     

    The whole complex signal is removed and the remaining signals are renumbered in sequence.

  4. Execute the following command:
  5. Edit-Paste-Normal 
     

    The complex (phasor) signal is inserted at the Target Marker location and the other signals are renumbered.

  6. Select a range of points in the signal S3 (the sawtooth signal).
  7. Execute the following command:
  8. Edit-Cut 
     

    The selected points are removed from the signal. Signal points to the right of the selection are moved to the left, filling in the gap left by the cut points, and the signal's total length is reduced.

  9. Move the Target Marker to the border between S2 and S3. The Target Indicator field at the top is updated.
  10. Execute the following command:
  11. Edit-Paste-Normal 
     

    The cut points are inserted into a new signal window between the S2 and S3 signals, becoming the new S3 signal.

Copying and Pasting

  1. Select all of signal S4.
  2. Execute the following command:
  3. Edit-Copy 
     

    The whole signal is copied to the Clipboard.

  4. With the Target Marker still between S2 and S3, execute the following command:
  5. Edit-Paste-Normal 
     

    A copy of the entire signal is pasted, becoming the new S3 signal.

  6. Select all of S3 and S4: click on the S3 button, hold down the Control key, and click on the S4 button.
  7. Execute the following command:
  8. Edit-Cut 
     

    Both signals are removed from the display, and the signals below them are renumbered sequentially.

    Note: The contents of the Clipboard are not visible.

  9. Click on the Calc button to bring back the calculator.

Using the Calculator

The calculator works just like a hand-held calculator, except that it performs mathematical calculations on signals as well as numbers.

The features of the calculator are shown in Figure 4-9.

Figure 4-9  Calculator

Keypad and Math Palette Buttons

Figure 4-10 describes the purpose of each button in the calculator keypad and Math palette.

Figure 4-10  Keypad and Math Palette Keys

You can use the calculator to perform numeric and signal calculations.

To perform a numeric calculation, click on the numeric keypad buttons as you would for an ordinary pocket calculator. The results are displayed in the Numeric field.

To perform a signal calculation, click on the signal buttons (S1, S2, and so forth) to select the desired signal and then click on the appropriate keypad buttons and function palette buttons. The calculation results are displayed in the TMP window.

For both numeric and signal calculations, the calculation sequence used to obtain the final result is shown in the Expr (Expression) field.

Calculation Exercises

The following exercises demonstrate the use of the calculator. For each exercise, perform the actions and button sequences in the order shown. The first few exercises show you how to perform calculations on simple numeric values. The remaining exercises show you how to perform calculations on signals.

In general, the Numeric and Expr fields are cleared automatically when you start a new calculation. If you make a mistake, click on the Clear button to clear these fields and start over.

Set Up the SigCalc Window

Before you begin the exercises, set up the SigCalc window using the following procedure:

  1. Execute the following command:
  2. Edit-Delete All 
    
  3. A dialog box warns you that the deleted signals cannot be recovered. Click on the OK button.
  4. Using the Win Size field, set the signal window size to 1000.
  5. Execute the following command:
  6. Customize-Numeric Display 
    
  7. In the dialog box, set the Floating Point Precision to 4 and then click on the OK button.
  8. Generate a new sine wave signal and a new square wave signal using the default signal-generation settings.

The Calculator's Expr field and TMP window should be empty.

Exercise 1: Add Numbers

Calculate the sum of numbers entered on the keypad. Use the sequence of actions shown in Table 4-4.

Table 4-4  Add Numbers Exercise
Select:
Expr Field
Numeric Field
2 button in the calculator keypad
2
2
+ button in the calculator keypad
2+
2.000
5 button in the calculator keypad
2+5
5
= button in the calculator keypad
(2+5)
7.000
+ button in the calculator keypad
(2+5)+
7.000
1 button in the calculator keypad
(2+5)+1
1
+ button in the calculator keypad
((2+5)+1)+
8.000
4 button in the calculator keypad
((2+5)+1)+4
4
= button in the calculator keypad
(((2+5)+1)+4)
12.00

Each time you key in a numeric value, the value is echoed in the Numeric field. When you press the Execute (=) button in the keypad, the expression is evaluated. Parentheses are inserted around the calculated expression in the Expr field and the result is displayed in the Numeric field. There is an implicit execute operation associated with the addition + button when a calculation is pending in the Expr field.

Exercise 2: Use the Math Function Keys

Calculate the trigonometric sine of p/3 using the sequence shown in the Table 4-5.

Table 4-5  Use the Math Palette Exercise
Select:
Expr Field
Numeric Field
p button in the calculator keypad
PI
3.14
³ button in the calculator keypad
PI/
3.14
3 button in the calculator keypad
PI/3
3
= button in the calculator keypad
(PI/3)
1.047
sin button in Math palette
sin(PI/3)
0.8660

Some Math functions, such as sin, ln, and square root, operate immediately on the expression in the Expr field. Others, such as X raised to the power of Y, require that you enter another value, followed by the = button to perform the calculation. Still others, such as integration, operate only on signals and do not work on simple numeric values.

If you wish, perform some numeric calculations of your own choice using the keypad and Math functions. When you are done, press the calculator's Clear button and continue with the next exercise.

Exercise 3: Store/Recall a Numeric Value

Calculate the square of the constant e and store the resulting value in Register R1 for future use. To verify that the value was saved, recall it from that register. Use the sequence shown in Table 4-6.

Table 4-6  Store/Recall a Numeric Value Exercise
Select:
Expr Field
Numeric Field
e button in keypad
e
2.718
x2 button in Math palette
pow(e,2)
7.389
Store R button
pow(e,2)
7.389
Clear button in keypad
 
 
Recall R button
 
7.389

There are four registers available for storing numeric values, designated R1 through R4. By default, R1 is the active register when SigCalc is invoked.

In the remaining exercises, you perform calculations on signals rather than numeric values.

Exercise 4: Add Signals

Calculate the sum of signals S1 and S2. The matching points of S1 and S2 are added, resulting in a new signal in the TMP window. When the User Action column says "Click on the S1 button," you can either click on the S1 button in the signal display area, or click on the S and 1 buttons in the calculator keypad. Use the sequence shown in Table 4-7.

Note: For a two-digit signal such as S12, you would click on the S button twice, followed by the two digits.

Table 4-7  Add Signals Exercise
Select:
Expr Field
TMP Signal Window
S1 button
S1
S1
+ button in keypad
S1+
S1
S2 button
S1+S2
S2
= button in keypad
(S1+S2)
Result of Expr

Exercise 5: Multiply Ranges of Points

Multiply a range of points in S1 with a different range of points in S2. Use the sequence shown in Table 4-8.

Table 4-8  Multiply Ranges of Points Exercise
Select:
Expr Field
TMP Signal
Window
Points 100-199 in S1 using the Select-Range command.
S1[100,199]
S1 with points 100 to 199 selected
X button in the calculator keypad
S1[100,199]*
S1 points 100 through 199 only
Points 200-299 in S2 using the Select-Range command.
S1[100,199]*
S2[200,299]
S2 with points 200 through 299 selected
= button in keypad
(S1[100,199]*
S2[200,299])
Result of Expr

Exercise 6: Signal/Numeric Calculation

Add 3.0, a constant, to every point in signal S1 and then calculate the natural logarithm of the result. Use the sequence shown in Table 4-9.

Table 4-9  Signal/Numeric Calculation Exercise
Select:
Expr Field
Numeric Field
TMP Signal
Window
S1 button
S1
 
S1
+ button in the calculator keypad
S1+
 
S1
3 button in the calculator keypad
S1+3
3
S1
= button in the calculator keypad
(S1+3)
3
Result of Expr
ln button in Math palette
ln(S1+3)
3
Result of Expr

The "ln" function operates on the last item in the Expr field. In this case, it operates on the sum of S1 and 3.0 because the whole expression (S1+3) is enclosed in parentheses in the Expr field.

Exercise 7: Signal/Numeric Calculation

Add the natural logarithm of 3.0 to every point in signal S1. Use the sequence shown in Table 4-10.

Table 4-10  Another Signal/Numeric Exercise
Click on the:
Expr Field
Numeric Field
TMP Signal
Window
S1 button
S1
 
S1
+ button in the calculator keypad
S1+
 
S1
3 button in the calculator keypad
S1+3
3
S1
In button in Math palette
S1+ln(3)
1.099
S1
= button in the calculator keypad
(S1+ln(3))
1.099
Result of Expr

In this case, the "ln" function operates on the numeric value 3.0, because "3" was the last item typed into the Expr field. The sum S1+3 had not yet been calculated, and was therefore not considered a single item. Compare this calculation with the previous example.

Exercise 8: Calculate and Store a Signal

Add the value of 2p, a constant, to every point in Signal S1 and then calculate the arc tangent of the result. Store the signal into the signal display area. Use the sequence shown in Table 4-11.

Table 4-11  Calculate and Store a Signal
Click on the:
Expr Field
Numeric Field
TMP Signal
Window
2 button in the calculator keypad
2
2
Unchanged
X button in the calculator keypad
2*
2.000
Unchanged
p button in the calculator keypad
2*PI
3.142
Unchanged
+ button in the calculator keypad
(2*PI)+
6.283
Unchanged
S1 button
(2*PI)+S1
6.283
S1
= button in the calculator keypad
((2*PI)+S1)
6.283
Result of Expr
arc then tan buttons in Math palette
atan((2*PI)+S1)
6.283
Result of Expr
Store button
atan((2*PI)+S1)
6.283
Result of Expr

When you click on the calculator's Store button, a copy of the TMP signal is inserted into the signal display area at the target position, creating a new S1 signal. Existing signals are renumbered in sequence.

The [Store] button stores a signal in the same manner that the Store R button stores a numeric value, except that the signal goes into the signal display area rather than a register. However, there is no Recall button to recall a signal; simply select a signal to copy into the TMP window. Signal display area storage is temporary; when you exit from SigCalc, the signals are lost. For permanent storage, you can save the signal as a disk file, as explained later in this tutorial chapter.

If you wish, perform some signal calculations of your own, using the signal selection buttons, keypad, and Math palette. Leave the Target Marker at the top of the signal display area, above S1.

You can type expressions directly into the Expr field and execute them by pressing the Return key. For example, enter "S1+S2+S3" into the Expr field, press the Return key, and the sum of the three signals is displayed in the TMP window.

Editing the Simulation Input Signal

The signal "mary.sig" is a speech signal that was sampled at a rate of 8,000 times per second, converted to digital format, and stored as a signal file. The whole signal contains about 47,600 data points, about 6 seconds of speech.

The signal's sampling frequency is 8,000, but the notch60 filter you are going to test was designed to operate with a sampling frequency of 2,000. To obtain the same signal waveform at the new sampling frequency, you must resample it by a factor of 4.

Load the Signal

  1. Execute the following command:
  2. Edit-Delete All 
    
  3. In the dialog box, click on the OK button
  4. Execute the following command:
  5. File-Open-Signals From Disk 
    
  6. Find the file name test_lib/mary.sig and double-click on it.
  7. Using the Win Size field, set the window size to 47600.
  8. The signal is displayed as signal S1, as shown in Figure 4-11. The figure also shows the words corresponding to the waveform.

Figure 4-11  Signal "mary.sig"

Play the Signal

If you are running SPW on a Sun SPARCstation, you can "play" the speech signal through the computer's audio output port and listen to the spoken words.

If you are running SPW on any platform other than a Sun SPARCstation, please skip this part and continue with the next subsection, Resample the Signal.

  1. Select S1, the speech signal.
  2. Execute the following command:
  3. Tools-User Program-Execute 
     

    This displays the "User Program Execute" file selection dialog box.

  4. Find the library name "demo/" and double-click on it.
  5. Find the user program name "play" and double-click on it.
  6. This displays the "SPW: demo/play" control window.

  7. In the control window, click on the Start button.
  8. After a brief delay, the user program plays the signal through the computer's audio speaker.

  9. In the control window, execute the following command:
  10. File-Close 
    

Resample the Signal

To resample the signal, follow these steps:

  1. Select S1, the speech signal.
  2. Using the calculator palette option button, change from Math functions to Filter functions, as shown in Figure 4-12.
Figure 4-12  Math and Filter Palettes

  1. Click on the Decimat button.
  2. In the dialog box, enter the value 4 into the Factor field.
  3. The Filter option should be toggled on, with the Number of Coefficients set to 25; this invokes an anti-aliasing filter that is applied to the signal before resampling takes place.

  4. Click on the OK button.
  5. The signal is resampled. The new signal is displayed in the TMP window. The sampling frequency of the signal changes from 8000 to 2000, and the number of points is reduced by a factor of 4.

  6. For a better view of the signal, set the Win Size value to 5000.
  7. Click on the Store button.
  8. The new signal is copied to signal window S1, as shown in Figure 4-13.

Figure 4-13  Edited Simulation Input Signal

  1. Change the calculator function palette option button from Filter to Math.

Add a 60-Hz Sine Wave

Next, you generate and add a 60-Hz sine wave to the speech signal. This serves as some 60-Hz noise that can be filtered out by the notch60 filter.

  1. Click on the Gen-Sine button in the command icon palette.
  2. In the Generate Sine Wave dialog box, set the sine wave characteristics as follows:
    • Amplitude: 0.1
    • Frequency: 60
    • End Frequency: Off
    • Phase in Degrees: 0
    • Envelope: Off
    • Number of Points: On, 11903
    • Sampling Frequency: On, 2000
  3. Click on the OK button to generate the signal, as shown in Figure 4-14.
Figure 4-14  60 Hz Sine Wave

  1. Using the calculator, add the 60 Hz sine wave (S1) to the speech signal (S2) and click on the execute (=) button.
  2. The sum of the sine and speech signals is generated and displayed in the TMP signal window.

  3. Move the Target Marker to the border between S2 and S3.
  4. Click on the Store button, and the signal is copied to a new S3 signal window, as shown in Figure 4-15.
Figure 4-15  Sum of S1 and S2 in S3

Enter Comment Line

You can use the long, narrow box at the top of a signal window to enter a comment line for that signal.

  1. Click on the comment box in S3.
  2. In the Comment field of the dialog box, type the following text:
  3. Noisy Mary

  4. Press the Return key.
  5. The comment "Noisy Mary" is displayed in the signal window.

Save the Signal File to Disk

Because the 60 Hz sine and "Noisy Mary" signals are new, their file name text fields contain empty rectangular boxes.

  1. Select S3, the "Noisy Mary" signal.
  2. Execute the following command:
  3. File-Save As 
    
  4. In the dialog box, enter the following text into the Filename field:
  5. yourlib/noisy

  6. Click on the OK button.
  7. The file name field in the S3 signal window is updated to show the file name, yourlib/noisy.

Exiting SigCalc

  1. In the SigCalc window, execute the following command:
  2. File-Close 
    
  3. When the system prompts "Do you really want to exit?," click on the Yes button.
  4. The Signal Calculator is removed from the screen.


CoWare
CoWare's Web Site
Phone: 1-888-269-2738
CoWare Customer Support