Difference between revisions of "Scilab/C4/Digital-Signal-Processing/English"
(Created page with ''''Title of script''': '''Signal processing Using Scilab''' '''Author: Manas''' '''Keywords: Video tutorial, Signal''' {| style="border-spacing:0;" ! <center>Visual Cue</cen…') |
|||
(One intermediate revision by one other user not shown) | |||
Line 33: | Line 33: | ||
|- | |- | ||
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Slide 4- Prerequisite slide | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Slide 4- Prerequisite slide | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Before practicing this tutorial, a learner should have a basic knowledge of Scilab. | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Before practicing this tutorial, a learner should have a basic knowledge of Scilab. |
+ | To know the basics of Scilab, please refer to the series of basic level spoken tutorials in Scilab.... | ||
− | |||
− | + | ....which is available on our website www.spoken-tutorial.org | |
− | which is available on our website www.spoken-tutorial.org | + | |
|- | |- | ||
Line 46: | Line 45: | ||
* Plotting continuous and discrete sine wave. | * Plotting continuous and discrete sine wave. | ||
− | * Plotting step function. | + | * Plotting '''step function'''. |
− | * Plotting ramp function. | + | * Plotting '''ramp function'''. |
Let me start with “Plotting continuous and discrete sine wave” | Let me start with “Plotting continuous and discrete sine wave” | ||
Line 69: | Line 68: | ||
− | and press Enter key on your keyboard. | + | and press '''Enter''' key on your keyboard. |
|- | |- | ||
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Display the plot generated | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Display the plot generated | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| This is a continous sine wave | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| This is a '''continous sine wave''' |
Line 85: | Line 84: | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Let us discuss the discrete sine wave. | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Let us discuss the '''discrete sine wave.''' |
− | On the console window type: plot two | + | On the console window type: '''plot two d3 within bracket invertes comma gnn comma t comma x and press Enter.''' |
Line 95: | Line 94: | ||
|- | |- | ||
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Display the plot generated | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Display the plot generated | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| This is | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| This is '''discrete sine wave.''' |
|- | |- | ||
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Switch to Slide 7: and display 2<sup>nd</sup> and 3<sup>rd</sup> point of Slide 7 | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Switch to Slide 7: and display 2<sup>nd</sup> and 3<sup>rd</sup> point of Slide 7 | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Let us now discuss about Plotting step function and | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Let us now discuss about Plotting '''step function''' and |
− | plotting ramp function. | + | plotting '''ramp function.''' |
|- | |- | ||
Line 107: | Line 106: | ||
Open the file signal.sce | Open the file signal.sce | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| I have already written the code to generate step and ramp signal in the file called signals.sce. | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| I have already written the code to generate '''step''' and '''ramp''' signal in the file called '''signals.sce.''' |
− | Let us open this file signal.sce using scilab editor. | + | Let us open this file '''signal.sce''' using '''scilab editor'''. |
Line 123: | Line 122: | ||
|- | |- | ||
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Display the plot generated | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Display the plot generated | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Step and Ramp signal is displayed in this plot. | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| '''Step''' and '''Ramp''' signal is displayed in this plot. |
|- | |- | ||
Line 130: | Line 129: | ||
− | Let us see how to perform Convolution between two signals. | + | Let us see how to perform '''Convolution''' between two signals. |
|- | |- | ||
Line 148: | Line 147: | ||
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Let us switch to the Scilab Console window and type | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Let us switch to the Scilab Console window and type | ||
− | '''x equals to | + | '''x equals to within square braccket one comma two comma three comma four''' |
− | |||
− | |||
+ | Then type '''h equals to within square bracket one comma one comma one''' | ||
− | Now let us apply the convoltion by typing''' convol opening bracket x comma h closing bracket''' | + | |
+ | Now let us apply the '''convoltion''' by typing''' convol opening bracket x comma h closing bracket''' | ||
Line 170: | Line 169: | ||
|- | |- | ||
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Now let us learn Discrete fourier transform for a discrete sequence by using the inbuilt command dft(). | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Now let us learn '''Discrete fourier transform''' for a discrete sequence by using the inbuilt command '''dft().''' |
|- | |- | ||
Line 177: | Line 176: | ||
Type: '''<nowiki>[xf]=dft(x,-1);</nowiki>''' | Type: '''<nowiki>[xf]=dft(x,-1);</nowiki>''' | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| On the console window here type '''x equals to | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| On the console window here type '''x equals to within square bracket one comma two comma three comma four''' |
Line 183: | Line 182: | ||
− | Type''' | + | Type''' within square bracket xf equals to dft into bracket x comma minus 1''' |
Line 208: | Line 207: | ||
'''- 2. - 2.i ''' | '''- 2. - 2.i ''' | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| The output appears as | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| The output appears as this |
Line 221: | Line 220: | ||
|- | |- | ||
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Now I will show you how to calculate inverse discrete fourier transform. This can be done by using the same inbuilt command dft(). | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Now I will show you how to calculate inverse discrete '''fourier transform'''. This can be done by using the same inbuilt command '''dft().''' |
|- | |- | ||
Line 227: | Line 226: | ||
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| On the Scilab console window type: | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| On the Scilab console window type: | ||
− | ''' | + | '''squareBracket x equals to dft within bracket xf comma 1''' |
− | Here the flag value is 1 for idft. | + | Here the '''flag value''' is 1 for '''idft.''' |
|- | |- | ||
Line 255: | Line 254: | ||
|- | |- | ||
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Let us calculate discrete fourier transform using fft() | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Let us calculate discrete fourier transform using '''fft()''' |
|- | |- | ||
Line 266: | Line 265: | ||
'''10. - 2. + 2.i - 2. - 2. - 2.i ''' | '''10. - 2. + 2.i - 2. - 2. - 2.i ''' | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| On the console window, type '''x= <nowiki>[1,2,3,4]</nowiki> x equals to | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| On the console window, type '''x= <nowiki>square [1,2,3,4]</nowiki> x equals to square bracket one comma two comma three comma four''' |
− | Press Enter and type '''y <nowiki>=</nowiki> fft(x,-1)''' y equals to fft | + | Press Enter and type '''y <nowiki>=</nowiki> fft(x,-1)''' y equals to fft within bracket x comma minus one |
− | Press Enter and you can see the output as | + | Press Enter and you can see the output as these:- |
Line 286: | Line 285: | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Let us now see how to calculate inverse discrete fourier transform by using fft(). | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Let us now see how to calculate inverse discrete fourier transform by using '''fft().''' |
On the Scilab console window type | On the Scilab console window type | ||
− | y equals to | + | '''y equals to within square bracket ten comma minus two plus two into percentage i comma minus two comma minus two minus two into percentage i.''' |
Line 297: | Line 296: | ||
− | Type '''x <nowiki>=</nowiki> fft(y,1)''' x equals to fft | + | Type '''x <nowiki>=</nowiki> fft(y,1)''' x equals to fft within bracket y comma 1 |
Line 336: | Line 335: | ||
− | Type '''x one equals to | + | Type '''x one equals to within square bracket one comma two comma three comma four'''and press Enter |
− | Type''' x2 equals to | + | Type''' x2 equals to within square braccket one comma three comma one comma five '''and press Enter |
− | Type ''' | + | Type '''R x one x two equals to corr within bracket x one comma x two comma four '''and press Enter |
Line 351: | Line 350: | ||
|- | |- | ||
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Let us learn | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Let us learn how to sample the given signal |
|- | |- | ||
Line 376: | Line 375: | ||
|- | |- | ||
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Let | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Let us summarise. |
|- | |- | ||
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Slide 14 | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Slide 14 | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| In this tutorial we learnt | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| In this tutorial we have learnt |
|- | |- | ||
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Display Summary slide | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Display Summary slide | ||
− | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| | + | | style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| How to Plot sine, step and ramp signal. |
Line 399: | Line 398: | ||
− | To do | + | To do sampling |
|- | |- | ||
Line 406: | Line 405: | ||
− | http://spoken-tutorial.org | + | this URL http://spoken-tutorial.org |
Line 421: | Line 420: | ||
− | bandwidth, you can download | + | bandwidth, you can also download |
Line 446: | Line 445: | ||
− | + | Please contact us | |
Line 492: | Line 491: | ||
− | by Manas and this is | + | by Manas and this is Sheetal Prabhu |
Latest revision as of 14:48, 20 May 2015
Title of script: Signal processing Using Scilab
Author: Manas
Keywords: Video tutorial, Signal
|
|
---|---|
Slide 1 | Dear Friends,
Welcome to the spoken tutorial on “Signal Processing using Scilab” |
Slide 2 -Learning Objective Slide | In this tutorial, using Scilab, I will show you how to
|
Slide 3-System Requirement slide | To record this tutorial, I am using Ubuntu 11.04 as the operating system with Scilab 5.3.3 version |
Slide 4- Prerequisite slide | Before practicing this tutorial, a learner should have a basic knowledge of Scilab.
To know the basics of Scilab, please refer to the series of basic level spoken tutorials in Scilab....
|
Slide 7 | In this tutorial, I will describe about 3 basic Signals.
Let me start with “Plotting continuous and discrete sine wave” |
Switch to the Scilab Console Window and type:
t = 0:0.1:2*%pi; x = sin(t); plot2d(t,x) |
Let us switch to the Scilab Console Window.
Here type:
x equal to sin of t semicolon plot 2D into bracket t comma x
|
Display the plot generated | This is a continous sine wave
|
On the console window type:
plot2d3('gnn',t,x)
|
Let us discuss the discrete sine wave.
|
Display the plot generated | This is discrete sine wave. |
Switch to Slide 7: and display 2nd and 3rd point of Slide 7 | Let us now discuss about Plotting step function and
plotting ramp function. |
Open scilab editor.
Open the file signal.sce |
I have already written the code to generate step and ramp signal in the file called signals.sce.
|
Display the plot generated | Step and Ramp signal is displayed in this plot. |
Slide 8 | Now let us learn how to perform different operations to analyse signals.
|
Swtich to Scilab console and type: x=[1,2 ,3,4]
Then type: h=[1,1,1] and then type
|
Let us switch to the Scilab Console window and type
x equals to within square braccket one comma two comma three comma four
|
Display the output generated | An output can be seen here. |
Now let us learn Discrete fourier transform for a discrete sequence by using the inbuilt command dft(). | |
On the Scilab console window, type: x=[1,2,3,4]
|
On the console window here type x equals to within square bracket one comma two comma three comma four
|
Display the output:
- 2. + 2.i - 2. - 9.797D-16i - 2. - 2.i |
The output appears as this
- 2. + 2.i - 2. - 9.797D-16i - 2. - 2.i |
Now I will show you how to calculate inverse discrete fourier transform. This can be done by using the same inbuilt command dft(). | |
On the Scilab console window:[x]=dft(xf,1) | On the Scilab console window type:
squareBracket x equals to dft within bracket xf comma 1
|
Display the output: 1.
2. + 5.551D-17i 3. - 1.225D-16i 4. - 5.551D-16i |
This is the output.
1. 2. + 5.551D-17i 3. - 1.225D-16i 4. - 5.551D-16i
|
Let us calculate discrete fourier transform using fft() | |
Type: x= [1,2,3,4] and press Enter
Type:y = fft(x,-1)
10. - 2. + 2.i - 2. - 2. - 2.i |
On the console window, type x= square [1,2,3,4] x equals to square bracket one comma two comma three comma four
Press Enter and type y = fft(x,-1) y equals to fft within bracket x comma minus one Press Enter and you can see the output as these:-
|
On the Scilab Console window type: y=[10,-2+2*%i,-2,-2-2*%i] and press Enter
|
Let us now see how to calculate inverse discrete fourier transform by using fft().
y equals to within square bracket ten comma minus two plus two into percentage i comma minus two comma minus two minus two into percentage i.
|
Display the output:
x =1. 2. 3. 4. |
The output will be displayed as
x =1. 2. 3. 4. |
Let us now find out the correlation between two vectors. | |
Switch to the Scilab console window
Rx1x2=1.25 0.3125 0.25 - 0.9375 |
To do this on the Scilab console window,
Rx1x2=1.25 0.3125 0.25 - 0.9375 |
Let us learn how to sample the given signal | |
Open sampling.sce
|
Let me open sampling.sce where
I have already written the code in sampling.sce
|
Let us summarise. | |
Slide 14 | In this tutorial we have learnt |
Display Summary slide | How to Plot sine, step and ramp signal.
|
Display “About the Spoken Tutorial Project” Slide | Watch the video available at
|
Display “ Spoken Tutorial Workshops” slide | The Spoken Tutorial Project Team
|
Display “Acknowledgment”
slide |
Spoken Tutorial Project is a part
|
Disaplay “Contributors” slide | This script has been contributed
|