6. Nov 2016•0 gefällt mir•158 views

Melden

Ingenieurwesen

lab reports for instrumentation and measurements course (labview examples)

- 2. “LIST OF LABS” 1. Implementing simple calculator in labview. 2. Computing formulas in labview. 3. Loops and if statements. 4. Implementing tables in labview. 5. Automatic lights switching in labview. 6. Traffic lights control in labview. 7. Water level control. 8. Automatic gear selector. 9. Image processing. 10.Audio signal processing. 11.Arithmetic operations on signals. 12.Noise and filtering.
- 3. LAB#01 “IMPLEMENTINGSIMPLECALCULATORINLABVIEW” TASK: Make a simple calculatorusinglabview. TOOLS: Numericcontrols. Numericindicator. Case structure. Enum. Addoperator. Subtract operator. Multiplyoperator. Divide operator. Square operator. Square root operator. FRONT PANEL: The front panel of the projectincludesthe: 1. Numeric controls: This tool is used to input numbers to perform different operations on them. 2. Enum: This tool contains list of operations. The user can switch between different options to select operation. 3. Numeric indicator: This tool is used to display results.
- 4. BLOCK DIAGRAM: The block diagram showsthe developmentstepsof project.The blockdiagramwindow has the: 1. Numericindicators. 2. Case structure. The case structure decidesthe true case ineach operation.The case structure containsthe gain blockfor eachoperation.Thenthe numericindicatorisconnectedatthe otherendtodisplaythe results.The enumselectsthe operationof the user’schoice.
- 5. RESULT:
- 6. LAB#02 “COMPUTINGFORMULAS INLABVIEW” TASK 1: Find the power factor of the following power triangle diagram using labview. The formula for power factor is given as: . P P f A cos . VI P f VI . cosP f TOOLS: Numeric controls. Numeric indicators. Multiply. Divide. Cos. Formula. PROJECT DEVELOPMENT: The project development steps are as follows:
- 8. FRONT PANEL: The front panel only contains: 1. Numeric Controls: To input the value for V and I to be used in the formula of power factor. 2. Numeric Indicators: To display the results of power factor in each case. The front panel is as follows: BLOCK DIAGRAM: The block diagram contains: 1. Numeric indicators: They show the result of the calculation. 2. Numericcontrols:Theyare usedtoinputthe valuesforvoltage andcurrent.Theyare actually used from the front panel. 3. Gain: There are two types of gain used. One is multiply and other is divide since the calculations require multiplication and division of certain terms. 4. Formula: It is used to build or input some formula that will automaticallybe calculatedand will generate the results. 5. Cos: This element is used to find the cos of some value being input to it.
- 9. TASK 2: Prove the Pythagoras theorem using labview. Pythagoras theorem states that: “In a right angled trianglethe square of the hypotenuse is equal to the sum of the squares of the other two sides.” 2 2 2 hypotenuse perpendicular base 2 2 hypotenuse perpendicular base So let us assume a triangle with the following lengths: Base = 3cm Hypotenuse = 5cm Perpendicular = 4cm Then,the labview implementationwillhave the followingarrangement.Square the inputsfor base and perpendicular and add them together and take the square root at the end. The result will give the length of hypotenuse of the given triangle. FRONT PANEL: The projectissimple withtwoinputsandone output.Forinputnumericcontrolsare usedand for out a numeric indicator is used.
- 10. BLOCK DIAGRAM: The block diagram has the square gain to square the values of base and perpendicular of triangle.Thenthe addgainadds upthe squaredvaluesandfinallythe square rootgaintakesthe root of the end result and sends to the numeric indicator to display. TASK 3: Implement the following temperature conversion formulas in labview. 1. Centigrade to Fahrenheit. 2. Fahrenheit to centigrade. 3. Centigrade to kelvin. The conversion formulas for temperature are as follows: Centigrade to Fahrenheit: 9 32 5 F C Fahrenheit to Centigrade: 5 ( 32) 9 C F Centigrade to Kelvin: 273K C
- 11. FRONT PANEL: BLOCK DIAGRAM: The block diagram contains the numeric controls for inputting the temperature. The temperature value isbeingfedtoformulablockwhichcontainsthe conversionformulaforeachtype of conversion. Then the result is being displayed on numeric indicator. The conversion for the giveninput of 20 for each type generates the following results when calculated manually using a calculator. 200 C=2930 K 200 F=-6.666660 F 200 C=680 F Comparing the results with labview model, it can be seen that the results are correct.
- 12. LAB#03 “LOOPSANDIFSTATEMENTSINLABVIEW” LOOPS: Loops are a set of statements whichare to be executedseveral times or are to be repeated again and again with different values. In C++ programming, there are three types of loops, namely; 1. While loop. 2. For loop. 3. Do while loop. WHILE LOOP: The syntax of while loop is; ( ) { ; } while condition code The while loopisusedwhenitisnotsure that whenthe loopisto be stopped.Soa condition is placed in the while condition. The loop continues till the condition in the code is true. When the conditionbecomesfalse,the loopstopsexecution.The codinginsidewhileloopwillneverbe executed if the condition comes to be true. FOR LOOP: The for loop has the following syntax; ( 0; ; ) { ; } for i i x i code Where i is the loop counter and x is the number of times the loop will be executed. The for loop is used when the number of terms a loop is executed is known. DO WHILE LOOP: The syntax for do while loop is;
- 13. { ; } ( ); do code while condition The do while loopresemblesthe while loop.The onlydifference isthatthe statementsinside the do while loopwillbe executedatleastonce even if the condition for while is found to be false. LOOPS IN LAB VIEW: The loops used in C++ programming can be implemented in labview via block diagrams. The procedure for implementation is as follows: WHILE LOOP: The block diagram representation of while loop in labview is as given below: This symbol in the diagram of while loop is named to be “loop iteration”.It tells us the number of times a loop has been executed. Thissymbol inthe diagramisthe representationof “loopcondition”.Itdecideswhen the loopis to be stopped.We can create a control withthisconditionsymbol tomanuallycontrol the execution of certain loop. The option of while loop can be found in labview by the following steps; Go tofunctionpaletteandselectthe programmingoption.Thengotostructuresandselectwhileloop.
- 14. FOR LOOP: The for loop is represented by the following symbol in lab view; Thissymbol isnamedtobe “loopiteration”andfunctionsthe same asincase of while loop. This symbol is named to be “loopcount”. The number of times we want the loop to be executed is fed to this terminal of the loop. The loop executes up to that value. The for loop is found in the labview as follows:
- 15. IF-ELSE STATEMENT: It is the conditional statement inwhichwe use differentconditionsinsidesame block.The if statement decides which block of statements to enter for execution. The compiler executes the statementsorset of statementswhen ifconditionis foundtrue.If the conditionisfoundto be false, then the else block is executed. The syntax for if statement is as given below: ( ) { ; } { ; } if condition code else code IF-ELSE STATEMENT IN LABVIEW: The if statement in labview is listed as “case structure”. The diagram for case structure is as follows: Bydefault,there are onlytwoconditionseithertrue orfalse.If the requiredconditionisfound true,the true blockis executed.If the conditionisfoundtobe false,the blockinthe falseconditionis executed. This block is named to be “case label”. It is the block in which the conditional cases are added. There is at least one default case for each condition. For each condition, there is a separate block diagram. The input and output is common for each condition. This block is called as “case selector”. This block selects the case to be executed.
- 16. TASK-1: Usingwhileloopimplementa model inlabviewwhichinputsa randomnumber andthen multiplyit with some nominal temperature and display it on a thermometer scale. FRONT PANEL: The front panel of the model contains a Thermometer:The thermometershowsthe changesoccurring in temperature on the scale. Loop Control: The loop control is a manual control which allows to stop the loop whenever wanted. The front panel appears to be as follows: BLOCK DIAGRAM: The block diagram of the model contains: Random Number: the random number is set of numbers ranging from 0-1. It is found in the following block of elements.
- 17. NumericConstant: It isa constantnumber.Itisbeingusedas a multiplicationfactorwiththe random number to range it from 1-10. It is also being used to add the random number with some nominal temperature value. Gain: Two types of gain are being used. One is multiplication and other is addition. While Loop: The while loop block executes the function of the block diagram continuously until being interrupted by the control switch which is connected to the loop condition. The block diagram of the model is as follows: RESULTS: The resultsof the abovemodelgenerateaconstantlychangingtemperature rangingfrom 250 -350 .The results are as follows:
- 18. TASK-2: Multiply two numbers using while loop and determine the number of times the loop has been executed. FRONT PANEL: The front panel of the model has the following blocks: Loop Control: The loopcontrol isa stopbuttonto stopthe loopexecutionwheneverdesired. NumericDisplay:One numericdisplaydisplaysthe resultsof the multiplicationof the entered numbers. The other display outputs the results of the number of times the loop has been executed. BLOCK DIAGRAM: The block diagram contains the following:
- 19. Numerical Constants: The numerical constants are two numbers being multiplied. Gain: The gain block is the multiplication of the numbers. While Loop:The whileloopexecutesthe multiplicationof numbersagainandagain.The block i is connected to the body of while loop and then to the numeric display. RESULTS: The results of the execution are as follows: The numeric 2 is displaying the no of times the loop has executed. TASK-3: Implement the table of 2 and 5 using fro loop in the labview model. FRONT PANEL: The front panel of the model contains: NumericControl: It controlsthe max value of loopcounter.The loopexecutesthe number of timesthe numberenteredinthisblock. Array Values: The array values displays the numbers in the for loop.
- 20. BLOCK DIAGRAM: The block diagram contains the following blocks: NumericConstant: The numberforwhichthe table isto be displayediswritteninthisblock. Increment: It increments the value of loop counter. Gain: It multiplies the number for which the table is to be generated by the number in the loop counter. Array: It generates an array of numbers. For Loop: It is usedto execute the same commandagain and againusingdifferentvaluesfor each execution. RESULTS: Table of 2:
- 21. Table of 5: Task-4: Using case structure implement temperature conversion formulas. FRONT PANEL: The front panel contains: Enum: Enumprovideslistof optionstobe writtenintoit.Itisusedwhennoof commandsare to be added to the same loop. Numeric Control: The temperature which is to be converted to other form is written in this block. Thermometer: It displays the resultant temperature on the scale.
- 22. BLOCK DIAGRAM: The block diagram contains: Enum: it allows to add different controls to case structure. Case Structure: It is the if else statement of labview. In this block the controls for each command are added. Numeric Control: The temperature to be converted is added in this block. Formula Block: The formula block contains conversion formula. Thermometer: The result of conversion are shown on thermometer scale. RESULTS: The results of conversion are as follows:
- 24. LAB#04 “IMPLEMENTINGTABLESINLABVIEW” TASK-1: Make a calculator using case structure in lab view. FRONT PANEL: The front panel of the project includes the: Numeric controls: It is used to input numbers for any kind of operation. Enum: it is used to select operation to be performed on numbers. Numeric indicator: It is used to display results. BLOCK DIAGRAM: The block diagram shows the development steps of project. The block diagram window has the: Numeric Control: to input numbers for the operation. Numeric Indicator: To display the results of operation. Enum: To select the desired operation. Case Structure: To decide the true case in each operation. Case Structure: The case structure decides the true case in each operation. The case structure contains the gain block for each operation. Then the numeric indicator is connectedat the otherendto displaythe results.The enumselectsthe operationof the user’s choice.
- 25. RESULT:
- 26. TASK 2: Implement the tables from 2-5 in labview using case structures and loops. FRONT PANEL: The front panel of the project contains: NumericControl: It controlsthe max value of loopcounter.The loopexecutesthe numberof times the number entered in this block. Array Values: The array values displays the numbers in the “for loop”. BLOCK DIAGRAM: The block diagram contains the following blocks: Numeric Control: Three numeric controls are there: Numeric control 3 contains the numbers of which table is being displayed. Numeric control 4 contains the case value. Numeric control 5 is displaying the value of loop counts. Increment: It increments the value of loop counter. Gain: It multiplies the number for which the table is to be generated by the number in the loop counter. Array: It generates an array of numbers. For Loop: It is usedto execute the same commandagain and againusingdifferentvalues for each execution. Case Structure: It is used to decide the correct case for the input number.
- 27. RESULTS: The result-s of the simulation are as follows: Table of 2: Table of 3: Table of 4:
- 28. Table of 5:
- 29. LAB#05 “AUTOMATICLIGHTSSWITCHINGINLABVIEW” LIGHT DETECTING RESISTORS: The lightdetectingresistorsare calledas LDR’s. These are variable resistorswhose resistance decreases with increasing light intensity. This phenomenon is called as photoconductivity. Theyare constructed with high resistance semiconductor material that is why the resistance of LDR’s is very high. The resistance lies in the range of mega-ohms. They are used in light sensing applications. If incident light on a photoresistor exceeds a certain frequency, photons absorbed by the semiconductorgive bound electrons enoughenergytojumpintothe conductionband.The resulting free electronsconductelectricity,therebylowering resistance.The resistance range andsensitivityof a photoresistor can substantially differ among dissimilar devices. Moreover, unique photo resistors may react substantially differently to photons within certain wavelength bands. TASK-1: Implementa project inlabviewwhichturns offthe lightsinthe hoursof daytime andturns them on in the night time. FRONT PANEL: The front panel of the project contains: Led’s:The LED’s inthe projectare the representationof streetlights.Theyare turnedonand off aftercalculatedperiodof time. Loop Control: The loopcontrol controlsthe loopexecutionmanually.The loopcanbe stoppedanytime usingthe loopcontrol button. The front panel of the projectisas follows:
- 30. BLOCK DIAGRAM: The blockdiagram of the projectcontains: LED’s: The LED’s representstreetlightswhichare tobe controlledautomatically. Local Variables:They provide control forLED’s.Theycan be usedin“write mode” i.e. commandscan be givento them.Orcan be usedin “read mode” i.e.commandscan be takenfromthem. Delay: It isa type of clockor timerthatcausesdelayinsome task.If a task isto be performedfora specifictime,thenthistool isusedtocause a delayand performitfor requiredtime. Flat Sequence:Thistool of labview performsatask insequentialorder.The tasksare performedinasequence inwhichtheyare placedinflatsequence cases. While Loop:The while loopwill keeponperformingthe taskplacedinside itaslongas required. Loop Control: itis a manual control for a loop.Loopcan be stoppedata desiredinstant usingthistool. The blockdiagram of the projectis as follows: PROCEDURE: The ideaof streetlightsisthattheyturn onautomaticallyinthe nighthoursandswitchoff by themselvesinthe daytimes.There canbe twoproceduresforcontrollingthe lights. i. By usingLDR’s anddark sensors. ii. Usingsome timercircuitthat turns themonfor some calculatedhoursandturns them off for the restof the time.
- 31. Implementingthe ideaof timersinlabviewrequiresthe followingprocedure. Let; 2 1sechours The time from5am-7pm can be consideredtobe the dayhours.They counttotallyas 14 hours.So; 14 7sechours The rest of the hoursfrom7pm-5am can be consideredtobe the nighttime whichare 10 hoursin total.So, 10 5sechours Step-1: Create local variable witheachLED.Connectthe local variable withthe LED. Covert the local variable to reading mode. Step-2: Create twoblocksof the flatsequence tool andplace the local variablesinsidethe flatsequence andsetthe local variablesto writingmode. Step-3: Create constantswithlocal variables.Inthe firstblockof flatsequence setthe local variable totrue case i.e.LEDs will turnon.Inthe secondblockof flatsequence,setthe local variablestofalse case i.e LED’swill turnoff. Step-4: Selectadelayfromtimersandplace one each ineach blockof flatsequence. Create a constant witheachtimerandwrite the desiredunitsof time ineachconstant. Step-5: Simulate the project. The simulation results are as follows:
- 32. TASK-2: Using the idea of delays, make a project in labview that controls the lightning system of a house. FRONT PANEL: The front panel of the project has the following tools: LED’s. Loop control. The loop controls is a manual control for stopping the loop at the desired time. The three LED’s representthe lightsof threedifferentareasinahouse.Theyrepresentthelightsof kitchen,TV lounge and outer lights. BLOCK DIAGRAM: The block diagram of the project has the following tools; LED’s: The LED’s representthe lightsof a certainhouse whichare to be controlled automatically. Local Variables:They provide control forLED’s. Delay: thisclocktimerprovidesdelayforturningthe LED’son andoff. Flat Sequence:Thistool helpstoturnon and turn off the lightsinsequential order. While Loop:The while loopwill keeponperformingthe taskplacedinside itaslongas required. Loop Control: It isa manual control fora loop.Loopcan be stoppedat a desiredinstant usingthistool. The blockdiagram of the projectis as follows:
- 33. PROJECT EXPLANATION: The requirement of the project is that the lights of the kitchen must turn ON by 7pm in the night, the lights of the TV lounge must turn ON by 9pm and the lights of the outer region e.g lawn must turn ON by 12pm in the night and all the lights must turn OFF altogether in the morning by around7AM. The calculatedtime forthese hoursis 5 seconds,4 secondsand 3 seconds respectively. Soeachof the sectioninflat sequence hasthedesireddelayinthe timerandthedesiredlocalvariables are being commanded to turn on or off the respective led’s in the front panel for required time. SIMULATION RESULTS: The results of simulation are as follows:
- 35. LAB#06 “TRAFFICLIGHTSCONTROL INLABVIEW” TASK: Control the traffic signal lights using delays in labview. PROJECT EXPLANATION: The requirements of the project are that the traffic signal lights must switch from one to anotheraftera calculated periodof time.All the lightsmuststay ON for a short spanof 3-4 minutes. Scaling the time span to sample time; Let, 1min 1sec , 3min 3sec then So the lights will turn ON for 3 seconds each. FRONT PANEL: The front panel of the project contains the following tools; 1. LED’s 2. Rectangle shape. The front panel view of the project is as given below.
- 36. BLOCK DIAGRAM: The block diagram of the project contains the following tools; 1. LED’s. 2. Local variables. 3. Flat sequence. 4. While loop. 5. Loop control. 6. Timer.
- 37. PROCEDURE: Inserta simple rectangularblockinthe blankVIfile.Thencollectthree LED’sand place them inthe project’sfrontpanel.Openthe colorpalletfromthe optionsandchange the colorsof the LED’s toturnthemredgreenandyellowtorepresentthetrafficsignallights.Arrange alltheLED’sinaproper sequence andplace themabove the rectangularbox.Groupall the shapesandtoolstogethersothey don’t move apart. Then open the block diagram and create the local variables associated with each LED. Create fourcopiesofeachLEDandcontainthree copiesinthe three sequencesof aflatsequence. Place a timerin each sequence of the flat sequence andsetthe timerto 3000ms. Containthe whole diagram in the while loop. Create a control with the loop control for manual control of loop. RESULTS: The results of the simulation are as follows:
- 38. LAB#07 “WATER LEVELCONTROL” TASK: Construct a model in labviewthat controls the water level automaticallysuch that when it reaches the value of about 80% of the total heightofthe tank, the water valve turns offand whenthe water level reaches the minimum value of about 10%, the valve opens up. FRONT PANEL: The front panel of the project contains the following tools. 1. Water tank. 2. Horizontal slider bar. 3. Vertical slider bar. 4. Numeric display. 5. LED’s. 6. Loop control. BLOCK DIAGRAM: The block diagram of the project contain the following tools. 1. Horizontal slider control. 2. Vertical slider control.
- 39. 3. Numeric constant. 4. Gain. 5. Feedback loop. 6. In-range. 7. Timer. 8. Loop control. 9. While loop. PROCEDURE: Collecta tankfrom the numericindicators.CollecttwoLED’sthat indicate the full andempty level of the tank.Change the color of the LED indicatingfull leveltogreenand the one indicatingthe empty level by red. Collect a horizontal and a vertical slide bars and place the along the tank. Name the horizontal slide bar as inflow and the vertical slide bar as outflow. When the inflow slide bar is full,the tank intakeswaterand fillsup.Whenthe outflow slide baris full,the tank dischargeswater and becomes empty. Openthe blockdiagram of the projectand subtract the value inthe outflow fromthe inflow. Then create a feedback loop and connect the results from the subtraction with the feedback loop througha tool named“in range”. Connecttwonumericconstantswitheach terminal of the in range and set the range from 0-100. Connect the output to the tank. Connect two gains with each LED in blockdiagram,one gaincomparesthe lessthanandequal valueandothercomparesgreaterthanand equal value. Connect the output from each LED to the tank. Simulate the project. RESULTS: The results of the simulation are as follows:
- 41. LAB#08 “AUTOMATIC GEARSELECTOR” SPEEDOMETER: A speedometer or a speed meter is a gauge that measures and displays the instantaneous speedof a vehicle.Nowuniversallyfittedtomotorvehicles,theystartedtobe available asoptionsin the 1900s, and as standard equipment from about 1910 onwards. Speedometers for other vehicles have specificnamesanduse othermeansof sensingspeed.Foraboat,thisisa pit log.Foran aircraft, this is an airspeed indicator. BRAKES: A brake is a mechanical device whichinhibitsmotion,slowingorstoppinga movingobjector preventing its motion.The rest of this article is dedicated to varioustypes of vehicular brakes.Most commonlybrakesuse frictionbetweentwosurfacespressedtogethertoconvertthe kineticenergyof the moving object into heat, though other methods of energy conversion may be employed. For example regenerative brakingconvertsmuchof the energytoelectrical energy,whichmaybe stored
- 42. for later use. Other methods convert kinetic energy into potential energy in such stored forms as pressurized air or pressurized oil. Eddy current brakes use magnetic fields to convert kinetic energy into electric current in the brake disc, fin, or rail, which is converted into heat. Still other braking methods even transform kinetic energy into different forms,for example by transferring the energy to a rotating flywheel. ACCELERATOR: A valve that regulatesthe flowof a fluid,suchas the valve in an internal-combustionengine that controlsthe amount of vaporizedfuel enteringthe cylinders.A leverorpedal controllingsucha valve. AUTOMATIC GEAR SYSTEM: An automatic transmission (also called automatic gearbox) is a type of motor vehicle transmissionthatcan automaticallychange gearratios as the vehicle moves,freeingthe driverfrom having to shift gears manually. Like other transmission systems on vehicles, it allows an internal combustionengine,bestsuitedtorunatarelativelyhighrotationalspeed,toprovidearange of speed and torque outputs necessary for vehicular travel. Electronically controlled transmissions, which appearon some newercars,still use hydraulicstoactuate the clutchesandbands,buteachhydraulic circuitiscontrolledbyanelectricsolenoid.Thissimplifiestheplumbingonthe transmissionandallows for more advanced control schemes.
- 43. TASK: Implement an automatic gear selector for a car that indicates the following for speed change. 1. When speed is zero, neutral gear is on. 2. When speed is between 0 and 20, gear 1 is on. 3. When speed is between 20 and 40, gear 2 is on. 4. When speed is between 40 and 60, gear 3 is on. 5. When speed is between 60 and 80, gear 4 is on. 6. When speed is above 90 the system gives a message to reduce the speed of vehicle. 7. For negative speed, reverse gear is active. IMPLEMENTATION: Tools: The implementation of the automatic gear selector requires the following tools: Horizontal slider. Meter. LED’s. Loop control.
- 44. And operator. Less than operator. Greater than operator. Numeric constants. Equal to zero operator. PROCEDURE: Make a connectionbetweenahorizontal sliderandmeter.Thentake aninputformthe slider and connect an equal to zero tool to it. From the output of the tool connect the wire to the neutral gear. Thentake two wiresfromthe sliderandconnect themto greaterand lessthan tool and to the otherterminalsof boththe tools,connectnumericconstantsthatdefine the range of the gears from 1-4. Then and the outputs from both the tools and connect themin the gears’ input. For the reduce speed message, take an input from the slider and connect a greater than tool and then connect the output to the respective LED. FRONT PANEL: The front panel of the project is as follows: BLOCK DIAGRAM: The block diagram of the project is as follows:
- 45. RESULTS:
- 46. LAB#09 “IMAGEPROCESSING” IMAGE: An image is an artifact that records visual perception. It is a 2D representation of a worldly thing i.e. objects, human or nature. An image is a visual representation of something. IMAGE PROCESSING: The analysis and manipulation of a digital image in order to improve its quality. To perform anyprocessonanimage inspecialdomainisreferredtoasimageprocessing.Itincludesmovingpixels, filtering, black and white image, blur, highlight the image. PIXELS: A pixel is a basic picture element. It is a point in a graphic image. Any graphical picture or displayiscomposedof thousandsandmillionsof smallblockscalledpixelswhichare arrangedinrows
- 47. andcolumns.Theyare place soclose togetherthattheyappearconnected.The physical size of apixel depends on the resolution of display or image. MONOCHROME IMAGE: A mono-chrome image isanimage thatcontainsonlyone color againsta neutral background such as a paintingora sketching. Oldgreenscreenmonitors are anexample of monochrome display. All black and white images are monochrome images but not all monochrome images are black and white. The range of pixels for a monochrome image is form 0-255. RGB IMAGE: RGB stands for “Red Green Blue”. It represents three hues of light that can be mixed to produce any othercolor.The mixingof highestintensityof all three colorsproduceswhitelightwhile the dimmestintensityproducesblackcolor.Anrgbimage isacoloredimage.Itcontainsallthe original colors. TRANSFORMATION: Transformationinimage processingcorrespondstoperforminganyoperationonanimage to convert it from one representation to another.The operationmay be a simple arithmetic operation or any complex operation. These operations include rotation, radon transform, fourier transform, hough transform, image interpolation etc.
- 48. IMAGE PROCESSING IN LABVIEW: Labview contains options to process an image. Therefore images can be processed using labview. Image processing in labview is somewhat difficult as compared to image processing in labview. Image processing in labview requires the following tools: 1. File path control. 2. Image data. 3. Read image. 4. New picture. 5. Draw flattened. 6. Unbundle. 7. Reverse 1D array. FILE PATH CONTROL: This tool provides the path to the image being processed. IMAGEDATA: Thistool revealsthe data containedinanimage suchas pixels,size,depthetc. READ IMAGE: This tool reads the image for processing. NEW PICTURE: This tool shows the image being read. REVERSE 1D ARRAY: This tool reverses the image. TASK-1: Process an image using LABView. FRONT PANEL: The front panel of the project is as follows:
- 49. BLOCK DIAGRAM: The block diagram for image processing can be drawn as follows: RESULTS:
- 50. IMAGE PROCESSING IN MATLAB: Image processinginMATLAB ispreferredbecause of ease of itsuse.Ithas itsbuiltinlibraries that make it easy to use. The commands are easy and self explaining. The following commands are used to read and show image using MATLAB; Imread: This command reads the image. The format of wirting this command is as given below: Imread(‘image.jpg/tif/png/jpeg’); Sometimes it is convenient to store the image in some variable for later processing. The command is then written as; X=Imread(‘image.jpg/tif/png/jpeg’); Where x is some variable. If the image is not in the workspace of MATLAB, thenthe image isaccessedby providingthe full path to the image in the argument of the above command as follows; x=imread('C:UsersdellPicturesCamera RollNew folderflynn.jpg'); Imshow: Thiscommandshowsthe image.The formatfor writingthiscommandisas follows: Imshow(‘image.jpg/jpeg/tif/png’); The following commands are used to increment, decrement or multiply some scalar to the pixels of an image thus changing its properties; Imadd: This command adds some scalar to the pixels of image being processed, thus increasing the brightness. The format for writing this command is as follows:
- 51. Imadd(image.jpg,n); Where n is the number to be added. Imsubtract: Thisnumbersubtractsascalarfromthe pixelsof animage beingprocessedhence darkeningthe image or in otherwords decreasingthe brightness.The formatfor writingthis command is as follows: Imsubtract(image.jpg,n); Where n is the number to be subtracted. Immultiply: This number multiplies some scalar to the pixels of image being processed.This commandchangesthe intensityof coloursinthe image.The formatforwritingthiscommand is as follows: Immultiply(image.jpg,n); Where n is the number to be multiplied. TASK-2: Process an image using MATLAB. The MATLAB commands for increasing or decreasing the brightness or changing the color intensitycanbe writtenasfollows.Allthe effectsare plottedinthe same figuretoobserve the effects clearly. MATLAB CODE: The matlab code for processing image can be written as follows: a=imread('cat.jpg'); c=immultiply(a,20); d=imsubtract(a,100); e=flipud(a); figure(1) subplot(2,2,1) imshow(a) subplot(2,2,2)
- 52. imshow(c) subplot(2,2,3) imshow(d) subplot(2,2,4) imshow(e) RESULTS: Executing the above commands generates the following results; ANALYSIS: Comparing the results of both the software, it can be observed that both the sofwares are capable of performing same operations and producing the same results.
- 53. LAB#10: “AUDIOSIGNAL PROCESSING” AUDIO SIGNAL PROCESSING: Audio signal processing, sometimes referred to as audio processing, is the intentional alterationof auditory signals,orsound,oftenthroughan audioeffectoreffectsunit. Asaudiosignals may be electronically represented in either digital or analog format, signal processing may occur in either domain. Analog processors operate directly on the electrical signal, while digital processors operate mathematically on the digital representation of that signal. .WAV SOUND FILES: .wav stands for waveform audio file format. It is a Microsoft and IBM audio file format standard for storing an audio bit stream on PCs. It is an application of the Resource Interchange File Format(RIFF) bitstreamformatmethodforstoringdatain"chunks",andthusisalsoclosetothe 8SVX andthe AIFFformatusedon AmigaandMacintoshcomputers,respectively.Itisthe mainformatused on Windows systemsforrawand typicallyuncompressedaudio.The usual bitstreamencodingisthe linear pulse-code modulation (LPCM) format. TASK: Process a .wav extension sound file using LABVIEW. TOOLS REQUIRED: To process a sound signal, in labview, we need following tools: 1. File path control. 2. Sound file (read/write). 3. Index array. 4. Graph. 5. Play waveform. 6. Get waveform. 7. Build waveform. 8. Sound file info. 9. Reciprocal. 10. Numeric indicators. 11. Build array.
- 54. PROCEDURE: Connect the file path control to the path terminal of the sound file read tool.Connect path out terminal to the index array’s array terminal then take the output from the element terminal. Connectthisoutputtothe dataterminalof the playwaveform,graphandgetwaveformcomponents. Connectthe Youtputfromgetwaveformcomponentstothe reverse 1Darrayand dt outputtothe dt tool. Also take the reciprocal of the dt tool input. Connect a numeric indicator with the reciprocal. Connectbuildwaveformtothe outputof reverse 1D array. Connectthe playwaveformtoerror in of anotherpalywaveformandconnectthedataterminalof playwaveform2tothe graphtool.Alsoinput the outputs of build array and build waveforms to the graph tool. EXPLANATION: The file path control tool provides the path to the desired sound file. The sound file is then readby the soundfile readtool.Thenanarrayisgeneratedcontainingthe elementsof the soundfile. The soundwave is convertedto1D array data. The original soundwave can be playedusingthe play waveformtool.Alsothe graphof the waveformcanbe seenusinggraphtool.Thenthe soundwave is ready to be processed. The desired waveform is then addedinto a get waveform tool and reversed using the reverse 1D array. The scattered data is then bundled together. Front panel: The front panel of the project is as follows:
- 55. BLOCK DIAGRAM: The block diagram of the project is as follows: RESULTS: The results of the simulation are as follows:
- 56. LAB#11: “ARITHMATIC OPERATIONS ONSIGNALS” SIGNAL: A gesture, action, or sound that is used to convey information or instructions, typically by prearrangement between the parties concerned. A detectable physical quantity or impulse (as a voltage, current, or magnetic field strength) by which messages or information can be transmitted." "A signal is a function of independent variables that carry some information." "A signal is a source of information generally a physical quantity which varies with respect to time, space, temperature like any independent variable" "A signal is a physical quantity that varies with time, space or any other independent variable.by which information can be conveyed." RMS VALUE: Inmathematics,the rootmeansquare (abbreviatedRMSorrms),alsoknownasthe quadratic mean, is a statistical measure of the magnitude of a varying quantity. It is especially useful when variantsare positive andnegative,e.g., sinusoids.Inthe fieldof electrical engineering,the RMSvalue of a periodic current or voltage is equal to the DC current or voltage that delivers the same average power to a resistor as the periodic current. The RMS value of a set of values (or a continuous-time waveform) is the square root of the arithmetic mean of the squares of the original values (or the square of the function that defines the continuous waveform). PEAK-PEAK VALUE: Peak-to-peak (pk-pk) is the difference between the maximum positive and the maximum negative amplitudes of a waveform. If there is no direct current (DC ) component in an alternating
- 57. current (AC ) wave, then the pk-pk amplitude is twice the peak amplitude.For an AC sine wave with no DC component,the peak-to-peakamplitude isequaltoapproximately 2.828 times the root-mean- square amplitude. Peak-to-peak values can be expressed for voltage, current , or power TASK: Generate different signalsapplyarithmeticoperationsonthem, findtheir parameters or attributes and indicate it on graph. TOOLS REQUIRED: Simulate signal. Waveform graph. Amplitude and level measurement. Multiply. Add. Subtract. TOOLS’ DESCRIPTION: 1. Simulate signal: This tool generates various signals such as sine, cosine, square wave, DC signal, triangular wave and saw tooth wave. The frequency and amplitude of these waves can also be controlled by this block. The phase and offset value can also be controlled. 2. Waveform graph: This tool displays the graph of the waveforms that are fed into it. 3. Amplitude and level measurement: This tool calculates different attributes related to the waveforms. These attributes include RMS value, average value, mean or DC value, positive peak value, negative peak value, peak-peak value, maximum value, minimum value. 4. Multiply: This tool multiplies the two input waveforms. 5. Subtract: This tool subtracts the input waveforms. 6. Add: This tool adds the two input waveforms.
- 58. PROCEDURE: Collecttwosimulate signal blocksfromtheexpressoptionandconnectthemtothe waveform graph. Thentake a multiply/add/subtracttool fromarithmeticoptionandinput the both waveforms intoit.Displaythe outputon the graph and alsoconnectit to the amplitude andlevel measurements tool.Go intothe parametersof amplitude andmeasurementsblockand checkall the attributesof a wave and then connect graphs to each of the outputs. FRONT PANEL: The front panel of the project is as follows: BLOCK DIAGRAM: The block diagram of the project is as follows:
- 59. RESULTS: The results for different mathematical operations on signals yielded the following results. Multiply: Multiplicationof triangularandsaw toothwave yieldsthe followingresults.The frequencyof the triangular wave is 10hz whereas the frequency of the saw tooth wave is 20 hz.
- 60. Multiplicationof a triangular and square wave yields the following results. The frequency of the triangular wave is 10hz whereas the frequency of the square wave is 20 hz. Add: The additionof asinusoidal waveandsquare wave yieldsthe followingresults.The frequency of the sine wave is 10hz whereas the frequency of the square wave is 20 hz. The addition of a sinusoidal wave and triangular wave yields the following results. The frequency of the sine wave is 10hz whereas the frequency of the triangular wave is 20 hz.
- 61. Subtract: The subtraction of square wave and saw tooth wave yields the following results. The frequency of the square wave is 10hz whereas the frequency of the saw tooth wave is 20 hz. The subtraction of the DC signal and the saw tooth wave gives the following results. The frequency of saw tooth wave is 20hz.
- 63. LAB#12 “NOISE ANDFILTERING” NOISE: Noise meansanyunwanted sound.Noise isnot necessarilyrandom.Inelectronics, noise isa randomfluctuationinanelectrical signal,acharacteristicof all electroniccircuits.Noisegeneratedby electronicdevicesvariesgreatly,asitcan be producedbyseveral differenteffects.In communication systems, noise is an error or undesired random disturbance of a useful information signal in a communicationchannel.The noiseisasummationof unwantedordisturbingenergyfromnatural and sometimes man-made sources. TYPES OF NOISE: There are various types of noise. Some of the types are as follows: GUASSIAN NOISE: Gaussiannoise is statistical noise havingaprobabilitydensityfunction (PDF) equal tothat of the normal distribution,whichisalsoknown as the Gaussiandistribution.Inotherwords, the values that the noise can take on are Gaussian-distributed.The probability densityfunction of a Gaussian random variable is given by: where represents the grey level, the mean value and the standard deviation. In telecommunications and computer networking, communication channels can be affected by wideband Gaussian noise coming from many natural sources, such as the thermal vibrations of atoms in conductors (referred to as thermal noise or Johnson-Nyquist noise), shot noise, black body radiation from the earth and other warm objects, and from celestial sources such as the Sun.
- 64. GUASSIAN WHITE NOISE: A special case is white Gaussian noise,in whichthe valuesat any pair of timesare identically distributed andstatisticallyindependent (andhenceuncorrelated).Incommunicationchanneltesting and modelling, Gaussian noise is used as additive white noise to generate additive white Gaussian noise. UNIFORM NOISE: "Uniform noise" generates a noise sequence having a uniform distribution function with values ranging from a to b. Its parameters are: Length N (in samples) Minimum value a Maximum value b The probability of an event occurring in the range from a to b is; 𝟏 𝒃 − 𝒂
- 65. POISSON NOISE: Poisson noise is also called shot noise. Poisson noise is a type of electronic noise which originates from the discrete nature of electric charge. The term also applies to photon counting in optical devices, where shot noise is associated with the particle nature of light. GAMMA NOISE: The gammadistributionisatwo-parameterfamilyof continuous probabilitydistributions.The common exponential distribution and chi-squared distribution are special cases of the gamma distribution. There are three different parameterizations in common use: 1. With a shape parameter k and a scale parameter θ. 2. Witha shape parameterα=k andan inverse scaleparameterβ =1/θ, calledarate parameter. 3. With a shape parameter k and a mean parameter μ = k/β. In each of these three forms, both parameters are positive real numbers PERIODIC RANDOM NOISE: PeriodicRandomNoise (PRN) isa summationof sinusoidal signalswiththe same amplitudes butwithrandomphases.PRN consistsof all sine waveswithfrequencies thatcanbe representedwith an integral number of cycles in the requested number of samples.Since PRN containsonly integral-
- 66. cycle sinusoids,youdonotneedtowindow PRN before youperformspectralanalysisbecause PRN is self-windowing and, therefore, has no spectral leakage. INVERSE F NOISE: Inverse f noise, also known as flicker noise or 1/f noise, is defined as a signal whose power spectrumisproportional tothe reciprocal of the frequency.Inverse f noise occursinmanyreal-world scenarios such as electronics, biological and chemical systems, and oceanography. BINOMIAL NOISE: Binomial noise is defined by a binomial distribution. The binomial distribution is a discrete probability distribution of the number of successes in a sequence of n independent yes or no experiments;eachof the independentexperimentshasaprobabilityequalto p.Binomialdistribution, like the Poisson distribution, is discrete.
- 67. FILTER: In signal processing, especiallyelectronics, an algorithm or device for removing parts of a signal. An electronic filter is an electronic circuit which processes signals, for example to remove unwanted frequency components. TYPES OF FILTERS: There are various types of filters. The common type of filters are as follows: HIGH PASS FILTERS: A high-pass filter is an electronic filter that passes signals with a frequency higher than a certaincutoff frequencyandattenuatessignalswithfrequencieslowerthanthe cutoff frequency.The amount of attenuation for each frequency depends on the filter design. LOW PASS FILTERS: A low-pass filter is a filter that passes signals with a frequency lower than a certain cutoff frequency and attenuates signals with frequencies higher than the cutoff frequency. The amount of attenuationforeachfrequencydependsonthe filterdesign.The filterissometimescalleda high-cut filter,or treble cut filter inaudioapplications. A low-pass filter is the opposite of a high-pass filter. BAND PASS FILTERS: A band-pass filter is a device that passes frequencies within a certain range and rejects (attenuates) frequencies outside that range. BAND STOP FILTERS: Also called band-elimination, band-reject, or notch filters. In signal processing,a band-stop filter or band-rejection filter is a filter that passes most frequencies unaltered, but attenuates those
- 68. in a specific range to very low levels. It is the opposite of a band-pass filter. A notch filter is a band- stop filter with a narrow stop band (high Q factor). Task: Take a signal, add noise to it TOOLS: The following tools are required to filter noise from a signal. Simulate signal. Graph. Filter. TOOLS DESCRIPTION: Simulate signal: This tool can generate different signals and also contains the option to produce noise in the signals. Graph:Thistool showsthe graphical representationof waveforms,noisesandfilteredsignals. Filter: like real time filters, the filter tool in LABview is meant to remove unwanted signals from the original signal. FRONT PANEL: The front panel view of the project is as follows:
- 69. BLOCK DIAGRAM: The block diagram of the project can be developed as follows: RESULTS: The results of the simulation are as follows:
- 73. MLS sequence: Inverse F noise:
- 74. ANALYSIS: In all of the above results, it can be observed that low pass filter, band stop filter and smoothing filters are producing good results of filtering. The original shape of the signal is not being regainedbutmuchof the noise isbeingreducedbythesefilters.Allotherfiltersare unable toremove or filter much noise from the signal. The most appropriate results from the fore mentioned filters is beingproducedbythe lowpass filter.The reasonis that the noise isa highfrequencysignal whichis being added to a normal or low frequency signal. So only low pass has the ability to reject the high frequenciesandpassall the lowfrequenciesefficiently.Sothe resultingwaveformissomewhatcloser to the original one.