Advance Java

Z-TRANSFORM

Posted on Updated on

Introduction, definition of z-transform, properties of z-transform, evaluation of

Inverse z-transform.

clip_image002[10]Introduction

Z-Transform is used for the transform of the discrete-time signals of one form to another form. Let x[n] is a given function, and then Z-Transform of x[n], X[z] isclip_image004[4].

clip_image006[4]X (z) =clip_image008[4]

1. Determine the Z-Transform of the following finite duration signals.

a). x(n)={3,1,2,5,7,0,1}

b). x (n) = {2, 4, 5, 4, 0, 1, 2}

c). x (n) = {1, 2, 5, 4, 0, 1}

d). x (n) = clip_image012[5](n)

e). x(n)= clip_image012[6](n-k)

f). x(n)= clip_image012[7](n+ k)

Solution:

a).

x(n)={3,1,2,5,7,0,1}

The position of arrow at five. Taking Z-transform, we get

X (z) =clip_image008[5]

= x (-3) clip_image016[6]+x (-2) clip_image018[6]+x(-1)clip_image020[8]+x (0)clip_image022[4]+ x (1)clip_image024+ x (2)clip_image026+ x(3)clip_image028

=3clip_image030 1 clip_image0322 clip_image034 5clip_image022[5]+7clip_image0360clip_image0381clip_image040

=3clip_image030[1] clip_image032[1]2 clip_image042 5+7clip_image036[1]0clip_image038[1]1clip_image040[1]

=3clip_image030[2] clip_image032[2]2 clip_image042[1] 5+7clip_image036[2]1clip_image040[2]

ROC: Entire z-plane except z=0 and z=clip_image044

b). x (n) = {2, 4, 5, 4, 0, 1, 2}

Solution: The position of arrow at four. Taking Z-transform, we get

X (z) =clip_image008[6]

=clip_image046x (-3) clip_image028[1]+x (-2) clip_image048+x(-1)clip_image050+x (0)clip_image022[6]+ x (1)clip_image024[1]+ x (2)clip_image052

=clip_image054 4 clip_image032[3]5 clip_image034[1] 4clip_image022[7]+0clip_image036[3]1clip_image038[2]2clip_image040[3]

=clip_image054[1] 4 clip_image032[4]5 clip_image042[2] 4clip_image0562clip_image040[4]

ROC: Entire z-plane except z=0 and z=clip_image044[1]

c). x (n) = {1, 2, 5, 4, 0, 1}

Solution: The position of arrow is not given. We will start from the first digit.

Taking Z-transform, we get

X (z) =clip_image008[7]

=clip_image046[1]x (0) clip_image058+x (1) clip_image020[9]+x (2)clip_image018[7]+x (3)clip_image040[5]+ x (4)clip_image060+ x (5)clip_image062

=clip_image064 2 clip_image036[4]5 clip_image038[3] 4clip_image040[6]+0clip_image0661clip_image062[1]

=clip_image064[1] 2 clip_image036[5]5 clip_image038[4] 4clip_image068

=clip_image064[2] clip_image070 clip_image072 clip_image074 clip_image076

ROC: Entire z-plane except z=0.

2. Determine the Z-Transform including the region of convergence of

x (n)=clip_image078

Solution: The Z-Transform for the given x(n) is

X (z) =clip_image008[8]

=clip_image080

=clip_image082+clip_image084+clip_image086+……….

= 1+ clip_image088 clip_image090……………

=clip_image092

= clip_image094

ROC:X (z) converges, when clip_image096 <1.

clip_image006[5] z >clip_image098

3. Find the Z-Transform of the following sequence

clip_image100

Solution: We know,

X (z) =clip_image008[9]

= clip_image102 clip_image104 clip_image106

={……….+clip_image108+clip_image110}+clip_image112+clip_image114+clip_image116+clip_image118+…}

+clip_image120 clip_image122 clip_image124 clip_image126 }

= {…..+ clip_image128+clip_image130} + {1 +clip_image132+ clip_image134+…} + {clip_image136+clip_image138+clip_image140+……}

= clip_image142+ clip_image144 + clip_image146

=clip_image148+clip_image150+clip_image152

4. Find the Z-Transform of the function x(n)=clip_image154 ,nclip_image1561

Solution: We know,

X (z) =clip_image008[10]

= clip_image158

= clip_image160

=clip_image162+clip_image164+clip_image166 +….

=clip_image168

clip_image006[6] X (z) converges, when clip_image096[1] <1, z>clip_image170

5. Find the Z-Transform of the function x(n)=clip_image172 ,nclip_image156[1]0

Solution: We know,

X (z) =clip_image008[11]

=clip_image174

= clip_image176

=clip_image178+clip_image180+clip_image182+….

= clip_image184

ROC: Entire z-plane.

clip_image186Z-Transform of some important functions

1. Unit impulse functions

clip_image012[8] (n)=1, for n=0

=clip_image188otherwise

We know,

X (z) =clip_image008[12]

=clip_image190

= {…..+0+0+1.z0+…..}

=1

ROC: Entire z-plane.

2. Unit step function

U (n) =1, for nclip_image156[2]0

=0, for n<0

We know,

X (z) =clip_image008[13]

=clip_image192

=clip_image194

=clip_image196+clip_image198+clip_image200+…

=clip_image202

=clip_image204

=clip_image206

clip_image208 ROC in the range of clip_image210<1 i.e. z>1

3. Find the Z-Transform of x (n) =clip_image212, nclip_image214.

Sol: We know,

X (z) =clip_image216

=clip_image218

=clip_image220

=clip_image222+clip_image224

= clip_image226+clip_image228

=clip_image230+clip_image232

=clip_image234

=clip_image236

=clip_image238

=clip_image240

4. *Find the Z-Transform of x (n) =clip_image242, nclip_image244

Sol: We know,

X (z) =clip_image216[1]

=clip_image246

=clip_image248

=clip_image250

= clip_image252

=clip_image254

=clip_image256

=clip_image258

=clip_image260

=clip_image262

5. Find the Z-Transform of x (n) =clip_image264, nclip_image244[1]

Sol:

We know,

X (z) =clip_image216[2]

=clip_image266

=clip_image268

=clip_image270

= clip_image272

=clip_image274

=clip_image276

=clip_image278

=clip_image280

=clip_image282

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Advertisements

DATA WAREHOUSING (introduction)

Posted on Updated on

INTRODUCTION TO DATA WAREHOUSING

  • A data warehouse is a repository of an organization’s electronically stored data. Data warehouses are designed to facilitate reporting and analysis.
  • A data warehouse is a powerful database model that significantly enhances the user’s ability to quickly analyze large, multidimensional data sets.
  • It cleanses and organizes data to allow users to make business decisions based on facts.
  • Hence, the data in the data warehouse must have strong analytical characteristics creating data to be analytical requires that it be  –subject- oriented, integrated, time – referenced and non – volatile.

 SUBJECT- ORIENTED DATA

·This means a data warehouse has a defined scope and it only stores data under that scope. So for example, if the sales team of your company is creating a data warehouse – the data warehouse by definition is required to contain data related to sales.

  • Data Warehouses group data by subject rather by activity. In contrast, transactional systems are organized around activities – payroll processing, shipping products, loan processing, and the like.
  • Data organized around activities cannot answer questions such as, “how many salaried employees have a tax deductions of ‘X’ amount across all branches of the company?’’ this request would require have searching and aggregation of employee and account records of all the branches.
  • Imagine the query response time for a company having branches all over the country with employee strength of 20,000!
  • In a data warehouse environment, information’s used for analysis is organized around subjects- employees, accounts sales, products, and so on. This subject specific design helps in reducing the query response time by searching through very few records to get an answer to the user’s question.

INTEGRATED DATA

  • Integrated data refers to de – duplicating information and merging it from many sources into one consistent location.
  • When short listing your top 20 customers, you must know that ‘’HAL’’ and ‘’Hindustan aeronautics limited’’ are one and the same. There must be just one customer number for any form of HAL or Hindustan aeronautics limited, in your database.

·         This means that the data stored in a data warehouse make sense. Fact and figures are related to each other and they are integrable and project a single point of truth.

  • Much of the transformation and loading work that foes into the data warehouse is centered on integrating data and standardizing it,

TIME – REFERENCED DATA

  • The most important and most scrutinized characteristic of the analytical data is its prior state of bing. In other words, time-referenced data essentially refers to its time – valued characteristic. For example, the user may ask ‘’what were the total sales of product ‘A’ for the past three years on New Year’s Day across region ‘Y’?’’ to answer this question, you need to know the sales figures of the product on new year’s day in all the branches for that particular region.
  • This means that data is not constant, as new and new data gets loaded in the warehouse, data warehouse also grows in size
  • Time – referenced data when analyzed can also help in spotting the hidden treads between different associative data elements, which may not be obvious to the naked eye. This exploration activity is termed ‘’data mining’’.

NON – VOLATILE DATA

  • Since the information in a data warehouse is heavily queried against time, it is extremely important to preserve it pertaining to each and every business event of the company. The non – volatility of data, characteristic of data warehouse, enables users to dig deep into history and arrive at specific business decisions based on facts.
  • This means that data once stored in the data warehouse are not removed or deleted from it and always stay there no matter what.

 NECESSITY –THE DATA ACCESS CRISIS

  • If there is a single key to survival in the 1990s and beyond, it is being able to analyze, plan, and react to changing business conditions in a much more repaid fashion. In order to do this, to managers, analysts, and knowledge workers in our enterprises, need more and better information.
  • Information technology (IT) has made possible the revolution in the way organizations operate throughout the world today. But the sad truth is, in many organizations, despite the availability of powerful computers on each desk and communication that span the globe, large numbers of executives and decision – makers cannot get their hands on exiting critical information in the organization.
  • Every day, organizations large and small, create billions of bytes of data about all aspects of their business; millions of individual facts about their customers, products, operations and people. But for the most part, this is locked up in a maze of computer systems and is exceedingly difficult to get at. This phenomenon has been described as “data in jail”.
  • Industry experts have estimated that only a small fraction of the data that is captured, processed and stored in the enterprise, is actually available to executives and decision makers. While technologies for the manipulation and presentations of data have literally exploded, it is only recently that those involved in developing IT strategies for large enterprise have concluded that large segments of the enterprise are “data poor”.

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Comments in C++

Posted on

For the students of FYBSc (IT), SYBSc (CS), SYBCA

if…else statement

An if statement can be followed by an optional else statement, which executes when the boolean expression is false.

Syntax:

The syntax of an if…else statement in C++ is:

if(boolean_expression){   // statement(s) will execute if the boolean expression is true}else{  // statement(s) will execute if the boolean expression is false}

If the boolean expression evaluates to true, then the if block of code will be executed, otherwise else block of code will be executed.

Flow Diagram:

11

Example:

#include <iostream>

using namespace std;

int main ()

{

// local variable declaration:

int a = 100;

// check the boolean condition

if( a < 20 )

{

// if condition is true then print the following

cout << “a is less than 20;” << endl;

}

else

{

// if condition is false then print the following

cout << “a is not less than 20;” << endl;

}

cout << “value of a is : ” << a << endl;

return 0;

}

When the above code is compiled and executed, it produces the following result:

a is not less than 20;

value of a is : 100

The if…else if…else Statement:

An if statement can be followed by an optional else if…else statement, which is very usefull to test various conditions using single if…else if statement.

When using if , else if , else statements there are few points to keep in mind.

  • An if can have zero or one else’s and it must come after any else if’s.
  • An if can have zero to many else if’s and they must come before the else.
  • Once an else if succeeds, none of he remaining else if’s or else’s will be tested.

Syntax:

The syntax of an if…else if…else statement in C++ is:

if(boolean_expression 1)

{

// Executes when the boolean expression 1 is true

}

else if( boolean_expression 2)

{

// Executes when the boolean expression 2 is true

}else if( boolean_expression 3)

{

// Executes when the boolean expression 3 is true

}

else

{

// executes when the none of the above condition is true.

}

Example:

#include <iostream>

using namespace std;

int main ()

{

// local variable declaration:

int a = 100;

// check the boolean condition

if( a == 10 )

{

// if condition is true then print the following

cout << “Value of a is 10” << endl;

}

else if( a == 20 )

{

// if else if condition is true

cout << “Value of a is 20” << endl;

}

else if( a == 30 )

{

// if else if condition is true

cout << “Value of a is 30” << endl;

}

else

{

// if none of the conditions is true

cout << “Value of a is not matching” << endl;

}

cout << “Exact value of a is : ” << a << endl;

return 0;

}

When the above code is compiled and executed, it produces the following result:

Value of a is not matching

Exact value of a is : 100

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

RAID stands for Redundant Array of Inexpensive (Independent) Disks

Posted on Updated on

On most situations you will be using one of the following four levels of RAIDs.

  • RAID 0
  • RAID 1
  • RAID 5
  • RAID 10 (also known as RAID 1+0)

This article explains the main difference between these raid levels along with an easy to understand diagram.
In all the diagrams mentioned below:

  • A, B, C, D, E and F – represents blocks
  • p1, p2, and p3 – represents parity
  • RAID LEVEL 0

11

Following are the key points to remember for RAID level 0.

  • Minimum 2 disks.
  • Excellent performance ( as blocks are striped ).
  • No redundancy ( no mirror, no parity ).
  • Don’t use this for any critical system.

12

  • RAID LEVEL 1

Following are the key points to remember for RAID level 1.

  • Minimum 2 disks.
  • Good performance ( no striping. no parity ).
  • Excellent redundancy ( as blocks are mirrored ).
  • RAID LEVEL 5

13

Following are the key points to remember for RAID level 5.

  • Minimum 3 disks.
  • Good performance ( as blocks are striped ).
  • Good redundancy ( distributed parity ).
  • Best cost effective option providing both performance and redundancy. Use this for DB that is heavily read oriented. Write operations will be slow.
  • RAID LEVEL 10

14

Following are the key points to remember for RAID level 10.

  • Minimum 4 disks.
  • This is also called as “stripe of mirrors”
  • Excellent redundancy ( as blocks are mirrored )
  • Excellent performance ( as blocks are striped )
  • If you can afford the dollar, this is the BEST option for any mission critical applications (especially databases).

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

A0 & A1:

Posted on Updated on

These two input lines allow the to specify which one of the internal
register in the 8253 is going to be used for the data transfer. Fig
shows how these two lines are used to select either the control word
register or one of the 16-bit counters. Eg, if there is a ‘1’ on both A0 &
A1, and a ‘0’ an , then the is writing a control word to the control
word register. These two pins are usually connected to the address
bus lines of the same name (A0 & A1).

11

Control word register:
It is selected when A0 and A1 re 11. It the accepts information from
the data bus buffer and stores it in a register. The information stored
in then register controls the operation mode of each counter,
selection of binary or BCD counting and the loading of each counting
and the loading of each count register. This register can be written
into, no read operation of this content is available.

Counters:
Each of the times has three pins associated with it. These are CLK
(CLK) the gate (GATE) and the output (OUT).
CLK:
This clock input pin provides 16-bit times with the signal to causes the
times to decrement maxm clock input is 2.6MHz. Note that the
counters operate at the negative edge (H1 to L0) of this clock input. If
the signal on this pin is generated by a fixed fq oscillator then the
user has implemented a standard timer. If the input signal is a string
of randomly occurring pulses, then it is called implementation of a
counter.

GATE:
The gate input pin is used to initiate or enable counting. The exact
effect of the gate signal depends on which of the six modes of
operation is chosen.

OUTPUT:
The output pin provides an output from the timer. It actual use
depends on the mode of operation of the timer. The counter can be
read “in the fly” without inhibiting gate pulse or clock input.

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Programmable Timer

Posted on Updated on

INTEL 8253 programmable Timer/ counter is a specially designed
chip for µC applications which require timing and counting operation.
These timing and counting functions can be implemented through
software. eg. A µC is required to execute N different tasks. Suppose
it is required after executing Task i. The software solution would be to
call a delay routine to count out a T seconds interval after Task i is
completed and then do Task j. In order to maintain the precision of
the delay, it will not be possible for µR to execute any other task
during this interval. If there are more such tasks, then µC will be busy
most of the time to execute the delay routines. If µC has to perform
some other useful task during (calculation) then it is very difficult.
The other possible solution is use of external timer. The µC may start
this timer after exactly the Task I then µC is free to do something
else. The extern timer after a delay of task interrupts the µP. The µC
executes task j once it get this interrupt. Such external device is
called a programmable timer 8253. The Intel 8253 is a programmable
counter/timer chip designed for use as an Intel µC peripheral. The
main uses of 8253 are as follows:

1). Interrupt a time sharing operating system at evenly spaced
intervals so that it can switch a program.
2). Programmable on shot generator
3). Serve as a programmable baud rate generator.
4). Measure time delays between external events
5). Count the number of times an event occurs.

6). Causes the processer to be interrupted after a programmed
number of external events have occurred.
7). Real time clock.
INTEL 8253 chip consists of three identical 16-bit timers. Each timer
may be programmed to operator in one of the sic modes,
independent of the mode of operation of the other two timers. The
timers are software programmable.
The maximum clock input to the timer is 2.6
The pin-configuration of 8253 is shown in fig.

11

The functional block diagram is shown below:

22

Functional description & Pin details:
Data Bus buffer:
The data bus buffer is bidirectional, 8-bit buffer and is used to
interface the 8253 to the system data bus. The operation of this buffer
is controlled by the chip select line ( ) which tells the 8253 that the
µΡ is trying to transfer information to or from it even though is part
of the READ/WRITE logic. Data is transmitted or received by the
buffer upon execution of INPUT instruction from CPU. The data bus
buffer has three basic functions,
(i). Programming the modes of 8253.

(ii). Loading the count value in times
(iii).Reading the count value from timers.
The data bus buffer is connected to µΡ using – pins which are
also bidirectional. The data transfer is through these pins. These pins
will be in high-impedance (or this state) condition until the 8253 is
selected by a LOW or . And either the read operation requested by
a LOW on the input or a write operation requested by the
input going LOW.
Read/ Write Logic:

It accepts inputs for the system control bus and in turn generation the
control signals for overall device operation. It is enabled or disabled
by so that no operation can occur to change the function unless
the device has been selected as the system logic.
CS:
The chip select input is used to enable the communicate between
8253 and the by means of data bus. A low an enables the data
bus buffers, while a high disables the buffer. The input does not
have any affect on the operation of three times once they have been
initialized. The normal configuration of a system employs an decode
logic which actives line, whenever a specific set of addresses that
correspond to 8253 appear on the address bus.

RD & WR :
The read ( ) and write pins central the direction of data transfer
on the 8-bit bus. When the input pin is low. Then CPU is inputting
data from 8253 in the form of counter value. When pins is low,then CPU is sending data to 8253 in the form of mode information or loading counters. The & should not both be low simultaneously. When & pins are HIGH, the data bus buffer is disabled.

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Array, Single & Multi Dimensional Array

Posted on

ARRAY:

Suppose we want to store 50 student names of a class. One might try to declare 50 variables, say st_name0, st_name1,..,st_name49. However, it is much better to define all those names in a single variable, which is called an array.

– An array is a collection of data of the same type (and therefore, the same size) stored in consecutive memory cells under one name.

– An entire array be declared all at once.

– Each individual element in the array can be referenced by indexing. Indexed means the array elements are numbered and always start at 0.

In C, an element of an array (i.e., an individual data item) is referred to by specifying the array name followed by one or more subscripts, with each subscript enclosed in square brackets.

Declaring an Array

int num[6] = {1, 3, 5, 7, 9, 11};
char letters[5] = {‘a’, ‘b’, ‘c’, ‘d’, ‘e’};
float numbers[3] = {13.25, 12.09, 8.1};

An array declaration is similar to the form of a normal declaration.The general form is :

Data type ArrayName[size] = { list of values }

SINGLE DIMENSIONAL ARRAY:

11

O/P:

22

MULTI DIMENSIONAL ARRAY:

A two-dimensional array can be used to represent a matrix,a table or board games (Tic Tac Toe, Sudoku etc).The row and column positions are given as successive indices.When you declare a variable of such an array, use a pair of square brackets for each dimension.

33

O/P:

44

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com