The best site for Articles and news

This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Saturday 17 December 2011

Pulse Modulation & its types


Pulse Modulation
-      consists essentially of sampling analog information signals and then converting those samples into discrete pulses and transporting the pulses from a source to a destination over a physical transmission medium

The four predominant methods of pulse modulation:
-      pulse width modulation
-      pulse position modulation
-      pulse amplitude modulation
-      pulse code modulation

Forms of Pulse modulation


Pulse Width Modulation (PWM)
-      is sometimes called pulse duration modulation (PDM) or pulse length modulation (PLM)
-      the width of a constant amplitude pulse is varied proportional to the amplitude of the analog signal at the time the signal is sampled
-      used in special-purpose communications system mainly for the military but are seldom used for commercial digital transmission
                             

Pulse Position Modulation (PPM)
-      the position of a constant-width pulse within a prescribed time slot is varied according to the amplitude of the sample of the analog signal
-      the higher the amplitude of the sample, the farther to the right the pulse is positioned within the prescribed time slot
-      the highest amplitude sample produces a pulse to the far right, and the lowest amplitude sample produces a pulse to the far left
-      also used in special-purpose communications system mainly for the military but are seldom used for commercial digital transmission



Pulse Amplitude Modulation (PAM)
-      the amplitude of a constant width, constant-position pulse is varied according to the amplitude of the sample of the analog signal
-      PAM waveforms resemble the original analog signal more than the waveforms for PWM or PPM
-      this is used as an intermediate form of modulation with PSK, QAM, and PCM, although it is seldom used by itself



Pulse Code Modulation (PCM)
-      the analog signal is sampled and then converted to a serial n-bit binary code for transmission
-      each code has the same number of bits and requires the same length of time for transmission


                                 
Share:

Friday 16 December 2011

Disadvantages of Digital Transmission


Disadvantages of Digital Transmission
-      the transmission of digitally encoded analog signals requires significantly more bandwidth than simply transmitting the original analog signal
-      needs additional encoding and decoding circuitry because analog signals must be converted to digital pulse prior to transmission and converted back to their original analog form at the receiver
-      digital transmission requires precise time synchronization between the clocks in the transmitters and receivers
-      incompatible with older analog transmission systems



Related:
Share:

Advantages of Digital Transmission


Advantages of Digital Transmission
-      noise immunity
o    pulses are evaluated during a precise time interval and a simple determination is made whether the pulse is above or below a prescribed reference level
-      better suited than analog signals for processing and combining using a technique called multiplexing
-      more resistant than analog systems to additive noise because they use signal regeneration rather than signal amplification
-      simpler to measure and evaluate



Related:
Share:

Digital Transmission


Digital Transmission
      is the transmittal of digital signals between two or more points in a communications system
      The signals can be binary or any other form of discrete-level digital pulses.

      The original source information may be in digital form, or it could be analog signals that have been converted to digital pulses prior to transmission and converted back to analog signals in the receiver.
      with digital transmission systems, a physical facility (pair of wires, coaxial cable, or an optical fiber cable) is required to interconnect the various points within the system



Related:
Share:

Friday 9 December 2011

String Functions in Visual Basic 6


VB has numerous built-in string functions for processing strings. Most VB string-handling functions return a string, although some return a number (such as the Len function, which returns the length of a string and functions like Instr and InstrRev, which return a character position within the string). The functions that return strings can be coded with or without the dollar sign ($) at the end, although it is more efficient to use the version with the dollar sign.
The first time I started trying to understand the VB6 string functions I was somewhat confused. This tutorial will walk you through all the different ways you can us VB to handle strings. If you are still confused feel free to post a comment and hopefully we can help get you cleared up. Also there are many other string related tutorials on this site so feel free to browse around.
Function:
Len
Description:
Returns a Long containing the length of the specified string
Syntax:
Len(string)
Where string is the string whose length (number of characters) is to be 
returned.
Example:
lngLen = Len("Visual Basic")    ' lngLen = 12


Function:
Mid$ (or Mid)
Description:
Returns a substring containing a specified number of characters from a 
string.
Syntax:
Mid$(string, start[, length])
The Mid$ function syntax has these parts:
string Required. String expression from which characters are returned.
start Required; Long. Character position in string at which the part to
 be taken begins. If start is greater than the number of characters in 
string, Mid returns a zero-length string ("").
length Optional; Long. Number of characters to return. If omitted or if 
there are fewer than length characters in the text (including the
 character at start), all characters from the start position to the end of
 the string are returned.

Example:

strSubstr = Mid$("Visual Basic", 3,       ' strSubstr = "sual"
Note: Mid$ can also be used on the left side of an assignment
 statement, where you can replace a substring within a string.
strTest = "Visual Basic"
Mid$(strTest, 3, 4) = "xxxx"

'strTest now contains "Vixxxx Basic"
In VB6, the Replace$ function was introduced, which can also be
 used to replace characters within a string.


Function:
Left$ (or Left)
Description:
Returns a substring containing a specified number of characters from
 the beginning (left side) of a string.
Syntax:
Left$(string, length)
The Left$ function syntax has these parts:
string Required. String expression from which the leftmost characters 
are returned.
length Required; Long. Numeric expression indicating how many 
characters to return. If 0, a zero-length string ("") is returned. If 
greater than or equal to the number of characters in string, the entire
string is returned.

Example:
strSubstr = Left$("Visual Basic", 3)    ' strSubstr = "Vis"

' Note that the same thing could be accomplished with Mid$:
strSubstr = Mid$("Visual Basic", 1, 3)


Function:
Right$ (or Right)
Description:
Returns a substring containing a specified number of characters from
 the end (right side) of a string.
Syntax:
Right$(string, length)
The Right$ function syntax has these parts:
string Required. String expression from which the rightmost 
characters are returned.
length Required; Long. Numeric expression indicating how many
 characters to return. If 0, a zero-length string ("") is returned.
If greater than or equal to the number of characters in string, the
 entire string is returned.
Example:
strSubstr = Right$("Visual Basic", 3)   ' strSubstr = "sic"

' Note that the same thing could be accomplished with Mid$:
strSubstr = Mid$("Visual Basic", 10, 3)


Function:
UCase$ (or UCase)
Description:
Converts all lowercase letters in a string to uppercase. Any existing
 uppercase letters and non-alpha characters remain unchanged.
Syntax:
UCase$(string)
Example:
strNew = UCase$("Visual Basic")     ' strNew = "VISUAL BASIC"


Function:
LCase$ (or LCase)
Description:
Converts all uppercase letters in a string to lowercase. Any existing
 lowercase letters and non-alpha characters remain unchanged.
Syntax:
LCase$(string)
Example:
strNew = LCase$("Visual Basic")     ' strNew = "visual basic"


Function:
Instr
Description:
Returns a Long specifying the position of one string within another.
The search starts either at the first character position or at the 
position specified by the start argument, and proceeds forward
 toward the end of the string (stopping when either string2 is found
 or when the end of the string1 is reached).
Syntax:
InStr([start,] string1, string2 [, compare])
The InStr function syntax has these parts:
start Optional. Numeric expression that sets the starting position
for each search. If omitted, search begins at the first character
position. The start argument is required if compare is specified.
string1 Required. String expression being searched.
string2 Required. String expression sought.
compare Optional; numeric. A value of 0 (the default) specifies
a binary (case-sensitive) search. A value of 1 specifies a
textual (case-insensitive) search.
Examples:
lngPos = Instr("Visual Basic", "a")
' lngPos = 5

lngPos = Instr(6, "Visual Basic", "a")
' lngPos = 9       (starting at position 6)

lngPos = Instr("Visual Basic", "A")
' lngPos = 0       (case-sensitive search)

lngPos = Instr(1, "Visual Basic", "A", 1)
' lngPos = 5       (case-insensitive search)


Function:
InstrRev
Description:
Returns a Long specifying the position of one string within another.
The search starts either at the last character position or at the
position specified by the start argument, and proceeds backward
toward the beginning of the string (stopping when either string2 is
found or when the beginning of the string1 is reached).
Introduced in VB 6.
Syntax:
InStrRev(string1, string2[, start, [, compare]])
The InStr function syntax has these parts:
string1 Required. String expression being searched.
string2 Required. String expression sought.
start Optional. Numeric expression that sets the starting position for
each search. If omitted, search begins at the last character position.
compare Optional; numeric. A value of 0 (the default) specifies a
binary (case-sensitive) search.
A value of 1 specifies a textual (case-insensitive) search.
Examples:
lngPos = InstrRev("Visual Basic", "a")
' lngPos = 9

lngPos = InstrRev("Visual Basic", "a", 6)
' lngPos = 5 (starting         at position 6)

lngPos =       InstrRev("Visual Basic", "A")
' lngPos = 0         (case-sensitive search)

lngPos =       InstrRev("Visual Basic", "A", , 1)
' lngPos = 9         (case-insensitive search)
' Note that this last example leaves a placeholder for the start argument

Notes on Instr and InstrRev:
·         Something to watch out for is that while Instr and InstrRev both accomplish
the same thing (except that InstrRev processes a string from last character to first
 while Instr processes a string from first character to last), the arguments to
these functions are specified in a different order. The Instr arguments are
(start, string1, string2, compare) whereas the InstrRev arguments are
(string1, string2, start, compare).
·         The Instr function has been around since the earlier days of BASIC,
whereas InstrRev was not introduced until VB 6.
·         Built-in "vb" constants can be used for the compare argument:
vbBinaryCompare for 0 (case-sensitive search)
vbTextCompare for 1 (case-insensitive search)

Function:
String$ (or String)
Description:
Returns a string containing a repeating character string of the
length specified.
Syntax:
String$(number, character)
The String$ function syntax has these parts:
number Required; Long. Length of the returned string.
character Required; Variant. This argument can either be a number
from 0 to 255 (representing the ASCII character code* of the
character to be repeated) or a string expression whose first character
is used to build the return string.
Examples:
strTest = String$(5, "a")
' strTest = "aaaaa"

strTest = String$(5, 97)
' strTest = "aaaaa" (97 is the ASCII code for "a")


Function:
Space$ (or Space)
Description:
Returns a string containing the specified number of blank spaces.
Syntax:
Space$(number)
Where number is the number of blank spaces desired.

Examples:
strTest = Space$(5)     ' strTest = "     "


Function:
Replace$ (or Replace)
Description:
Returns a string in which a specified substring has been replaced
with another substring a specified number of times.
Introduced in VB 6.
Syntax:
Replace$(expressionfindreplacewith[, start[, count[, compare]]])
The Replace$ function syntax has these parts:
expression Required. String expression containing sub-string
to replace.
find Required. Substring being searched for.
replacewith Required. Replacement substring.
start Optional. Position within expression where sub-string
search is to begin. If omitted, 1 is assumed.
count Optional. Number of substring substitutions to perform.
If omitted, the default value is –1, which means make all
possible substitutions.
compare Optional. Numeric value indicating the kind of comparison to
use when evaluating substrings. (0 = case sensitive, 1 = case-insensitive)
Built-in "vb" constants can be used for the compare argument:
vbBinaryCompare for 0 (case-sensitive search)
vbTextCompare for 1 (case-insensitive search)
Examples:
strNewDate = Replace$("08/31/2001", "/", "-")
' strNewDate = "08-31-2001"


Function:
StrReverse$ (or StrReverse)
Description:
Returns a string in which the character order of a specified string is reversed.
Introduced in VB 6.
Syntax:
StrReverse$(string)
Examples:
strTest = StrReverse$("Visual Basic")    ' strTest = "cisaBlausiV"



Function:
LTrim$ (or LTrim)
Description:
Removes leading blank spaces from a string.
Syntax:
LTrim$(string)
Examples:
strTest =         LTrim$("  Visual Basic  ")
' strTest =         "Visual Basic  "


Function:
RTrim$ (or RTrim)
Description:
Removes trailing blank spaces from a string.
Syntax:
RTrim$(string)
Examples:
strTest = RTrim$("Visual Basic")      ' strTest = "Visual Basic"


Function:
Trim$ (or Trim)
Description:
Removes both leading and trailing blank spaces from a string.
Syntax:
Trim$(string)
Examples:
strTest = Trim$("  Visual Basic  ")   ' strTest = "Visual Basic"
' Note: Trim$(x) accomplishes the same thing as LTrim$(RTrim$(x))


Function:
Asc
Description:
Returns an Integer representing the ASCII character code corresponding
to the first letter in a string.
Syntax:
Asc(string)
Examples:
intCode = Asc("*")      ' intCode = 42
intCode = Asc("ABC")    ' intCode = 65


Function:
Chr$ (or Chr)
Description:
Returns a string containing the character associated with the specified
character code.
Syntax:
Chr$(charcode)
Where charcode is a number from 0 to 255 that identifies the character.
Examples:
strChar = Chr$(65)     ' strChar = "A"



Share:

Popular Posts