Sunday, April 15, 2012

How to Compile a C Program Using the GNU Compiler (GCC)




  1. In order to see if you have the GNU C/C++ compiler installed on your system
    • Type/Copy/Paste: gcc --version
    • If the command is not found, it is likely that gcc/g++ isn't installed.
  2. 3
    Install gcc/g++ on your system, consult your Unix or GNU/Linux distribution documentation for the appropriate installation method. If you are using Microsoft Windows, please see the following installation method used to install MinGW GNU C/C++ compiler for Microsoft Windows How to install MinGW( Minimalist GNU C/C++ Compiler) on Microsoft Windows
  3. 4
    First, create a working directory using the following command:
    • Type/Copy/Paste: mkdir CCPP
  4. 5
    Second, change into the directory
    • Type/Copy/Paste: cd CCPP
  5. 6
    Third, use a text editor such as nano, gedit, vi, notepad,(on Microsoft Windows ) for example,
  6. 7
    Unix/GNU/Linux Instructions:
    • Type/Copy/Paste: nano main.c
    • Type/Copy/Paste: gedit main.c
    • Type/Copy/Paste: vi main.c
  7. 8
    Windows Instructions:
    • Type/Copy/Paste: notepad main.c
    • You can use notepad as a text editor on Microsoft Windows
  8. 9
    Enter the following source code below:
  9. 10
    Type/Copy/Paste:
    • #include
    • #include
    • int main()
    • {
    • printf("Hello World\n");
    • return(0);
    • }
  10. 11
    Once this task is complete save the source code as a text file in your editor asmain.c
  11. 12
    Fourth, compile the file by issuing the following command
    • Type/Copy/Paste:
    • gcc main.c -o HelloWorld
  12. 13
    Fifth, run the command by issuing the following command
  13. 14
    Unix/GNU/Linux instructions:
    • Type/Copy/Paste: ./HelloWorld
  14. 15
    Microsoft Windows Instructions:
    • Type/Copy/Paste: HelloWorld.exe
    • On Windows when the HelloWorld.c file is compiled it will usually have an .exe extention.
  15. 16
    To compile multiple files:
    • Type/Copy/Paste:
    • gcc -o outputfile file1.c file2.c file3.c
  16. 17
    To compile with more error checking using the -Wall tag:
    • Type/Copy/Paste:
    • gcc -Wall -o outputfile file1.c
  17. 18
    To compile files without linking them:
    • Type/Copy/Paste:
    • gcc -c file1.c file2.c file3.c
    • After the last step, if you want to link them, type: gcc -o outputfile file1.o file2.o file3.o


Thanks to:

Sunday, April 8, 2012

How will determine if a station is connected to an Access point in HT20 or HT40 ( in a linux based Systems)



Getting link status



To determine if you are connected to an AP or not and if you are the last TX rate used you can use the command below.
Example output when associated to a legacy (non-802.11n) AP:
iw dev wlan0 link
Connected to 04:21:b0:e8:c8:8b (on wlan0)
        SSID: attwifi
        freq: 2437
        RX: 2272 bytes (18 packets)
        TX: 232 bytes (3 packets)
        signal: -57 dBm
        tx bitrate: 36.0 MBit/s
Example output when associated to an 802.11n AP:
iw dev wlan0 link
Connected to 68:7f:74:3b:b0:01 (on wlan0)
        SSID: tesla-5g-bcm
        freq: 5745
        RX: 30206 bytes (201 packets)
        TX: 4084 bytes (23 packets)
        signal: -31 dBm
        tx bitrate: 300.0 MBit/s MCS 15 40Mhz short GI
Example output when not connected to an AP:
iw dev wlan0 link
Not connected.
This would happen if you are not connected to an AP. To connect to an AP you can use iw connect if the connection requires:
  • No encryption
  • Uses WEP for encryption
If you need to connect to an AP with WPA or WPA2 encryption requirements then you must usewpa_supplicant.

Thanks to : 

Anechoic chamber


An anechoic (an-echoic meaning non-echoing or echo-free) is a room designed to stop reflections of either sound or electromagnetic waves. They are also insulated from exterior sources of noise. The combination of both aspects means they simulate a quiet open-space of infinite dimension, which is useful when exterior influences would otherwise give false results.
Anechoic chambers, a term coined by American acoustics expert Leo Beranek, were originally used in the context of acoustics(sound waves) to minimize the reflections of a room. More recently, rooms designed to reduce reflection and external noise in radio frequencies have been used to test antennas, radars, or electromagnetic interference.
Anechoic chambers range from small compartments the size of household microwave ovens to ones as large as aircraft hangars. The size of the chamber depends on the size of the objects to be tested and the frequency range of the signals used, although scale models can sometimes be used by testing at shorter wavelengths.

Contents

  [hide

Acoustic anechoic chambers

Anechoic chambers are commonly used in acoustics to conduct experiments in nominally "free field" conditions. All sound energy will be traveling away from the source with almost none reflected back. Common anechoic chamber experiments include measuring the transfer function of a loudspeaker or the directivity of noise radiation from industrial machinery. In general, the interior of an anechoic chamber is very quiet, with typical noise levels in the 10–20 dBA range. According to Guinness World Records, 2005, Orfield Laboratory's NIST certified Eckel Industries-designed anechoic chamber is "The quietest place on earth" measured at −9.4 dBA.[1][2] The human ear can typically detect sounds above 0 dBA, so a human in such a chamber would perceive the surroundings as devoid of sound.

The University of Salford has a number of Anechoic chambers, of which one is unofficially the quietest in the world with a measurement of −12.4 dBA.[3]


Semi-anechoic chambers

Full anechoic chambers aim to absorb energy in all directions. Semi-anechoic chambers have a solid floor that acts as a work surface for supporting heavy items, such as cars, washing machines, or industrial machinery, rather than the mesh floor grille over absorbent tiles found in full anechoic chambers. This floor is damped and floating on absorbent buffers to isolate it from outside vibration or electromagnetic signals. A recording studio may utilize a semi-anechoic chamber to produce high-quality music free of outside noise and unwanted echoes.


Radio-frequency anechoic chambers

An RF anechoic chamber.
The internal appearance of the radio frequency (RF) anechoic chamber is sometimes similar to that of an acoustic anechoic chamber, however, the interior surfaces of the RF anechoic chamber are covered with radiation absorbent material (RAM) instead of acoustically absorbent material [1]. The RF anechoic chamber is typically used to house the equipment for performing measurements of antenna radiation patterns, electromagnetic compatibility (EMC) and radar cross sectionmeasurements. Testing can be conducted on full-scale objects, including aircraft, or on scale models where the wavelength of the measuring radiation is scaled in direct proportion to the target size. Coincidentally, many RF anechoic chambers which use pyramidal RAM also exhibit some of the properties of an acoustic anechoic chamber, such as attenuation of sound and shielding from outside noise.


Radiation absorbent material

The RAM is designed and shaped to absorb incident RF radiation (also known as non-ionising radiation), as effectively as possible, from as many incident directions as possible. The more effective the RAM is the less will be the level of reflected RF radiation. Many measurements in electromagnetic compatibility (EMC) and antenna radiation patterns require that spurious signals arising from the test setup, including reflections, are negligible to avoid the risk of causing measurement errors and ambiguities.
One of the most effective types of RAM comprises arrays of pyramid shaped pieces, each of which is constructed from a suitably lossy material. To work effectively, all internal surfaces of the anechoic chamber must be entirely covered with RAM. Sections of RAM may be temporarily removed to install equipment but they must be replaced before performing any tests. To be sufficiently lossy, RAM can neither be a good electrical conductor nor a good electrical insulator as neither type actually absorbs any power. Typically pyramidal RAM will comprise a rubberized foam material impregnated with controlled mixtures of carbon and iron. The length from base to tip of the pyramid structure is chosen based on the lowest expected frequency and the amount of absorption required. For low frequency damping, this distance is often 24 inches, while high frequency panels are as short as 3–4 inches. Panels of RAM are installed with the tips pointing inward to the chamber. Pyramidal RAM attenuates signal by two effects: scattering and absorption. Scattering can occur both coherently, when reflected waves are in-phase but directed away from the receiver, or incoherently where waves are picked up by the receiver but are out of phase and thus have lower signal strength. This incoherent scattering also occurs within the foam structure, with the suspended carbon particles promoting destructive interference. Internal scattering can result in as much as 10 dB of attenuation. Meanwhile, the pyramid shapes are cut at angles that maximize the number of bounces a wave makes within the structure. With each bounce, the wave loses energy to the foam material and thus exits with lower signal strength.[4]
An alternative type of RAM comprises flat plates of ferrite material, in the form of flat tiles fixed to all interior surfaces of the chamber. This type has a smaller effective frequency range than the pyramidal RAM and is designed to be fixed to good conductive surfaces. It is generally easier to fit and more durable than the pyramidal type RAM but is less effective at higher frequencies. Its performance might however be quite adequate if tests are limited to lower frequencies (ferrite plates have a damping curve that makes them most effective between 30–1000 MHz)[2].
There is also a hybrid type, a ferrite in pyramidal shape. Containing the advantages of both technologies the frequency range can be maximized while the pyramid remains small (10 cm)[3].


Effectiveness over frequency

Close-up of a pyramidal RAM
Waves of higher frequencies have shorter wavelengths and are higher in energy, while waves of lower frequencies have longer wavelengths and are lower in energy, according to the relationship \lambda= v/f where lambda represents wavelength, v is phase velocity of wave, and f is frequency. To shield for a specific wavelength, the cone must be of appropriate size to absorb that wavelength. The performance quality of an RF anechoic chamber is determined by its lowest test frequency of operation, at which measured reflections from the internal surfaces will be the most significant compared to higher frequencies. Pyramidal RAM is at its most absorptive when the incident wave is at normal incidence to the internal chamber surface and the pyramid height is approximately equal to \lambda/4, where \lambda is the free space wavelength. Accordingly, increasing the pyramid height of the RAM for the same (square) base size improves the effectiveness of the chamber at low frequencies but results in increased cost and a reduced unobstructed working volume that is available inside a chamber of defined size.


Installation into a screened room

An RF anechoic chamber is usually built into a screened room, designed using the Faraday cage principle. This is because most of the RF tests that require an anechoic chamber to minimize reflections from the inner surfaces also require the properties of a screened room to attenuate unwanted signals penetrating inwards and causing interference to the equipment under test and prevent leakage from tests penetrating outside.


Chamber size and commissioning

The actual test setups usually require extra room—more than that required to simply house the test equipment, the hardware under test and associated cables. For example, the far field criteria sets a minimum distance between the transmitting antenna and the receiving antenna to be observed when measuring antenna radiation patterns. Allowing for this and the extra space that may be required for the pyramidal RAM means that a substantial capital investment is required into even a modestly dimensioned chamber. For most companies, such an investment in a large RF anechoic chamber is not justifiable unless it is likely to be used continuously or perhaps rented out. Sometimes for radar cross section measurements it is possible to scale down the objects under test and reduce the chamber size provided that the wavelength of the test frequency is scaled down in direct proportion.
RF anechoic chambers are normally designed to meet the electrical requirements of one or more accredited standards. For example, the aircraft industry may test equipment for aircraft according to company specifications or military specifications such as MIL-STD 461E. Once built, acceptance tests are performed during commissioning to verify that the standard(s) are in fact met. Provided they are, a certificate will be issued to that effect, valid for a limited period.

Operational use

Test and supporting equipment configurations to be used within anechoic chambers must expose as few metallic (conductive) surfaces as possible, as these risk causing unwanted reflections. Often this is achieved by using non-conductive plastic or wooden structures for supporting the equipment under test. Where metallic surfaces are unavoidable, they may be covered with pieces of RAM after setting up to minimize such reflection as far as possible.
A careful assessment is required of whether to place the test equipment (as opposed to the equipment under test) on the interior or exterior of the chamber. Normally this may be located outside of the chamber provided it is not susceptible to interference from exterior fields which, otherwise, would not be present inside the chamber. This has the advantage of reducing reflection surfaces inside but it requires extra cables and particularly good filtering. Unnecessary cables and/or poor filtering can collect interference on the outside and conduct them to the inside. A good compromise may be to install human interface equipment (such as PCs), electrically noisy and high power equipment on the outside and sensitive equipment on the inside.
One useful application of fiber optic cables is to provide the communications links to carry signals within the chamber. Fiber optic cables are non-conductive and of small cross-section and therefore cause negligible reflections in most applications.
It is normal to filter electrical power supplies for use within the anechoic chamber as unfiltered supplies present a risk of unwanted signals being conducted into and out of the chamber along the power cables.


Health and safety risks associated with RF anechoic chamber

The following health and safety risks are associated with RF anechoic chambers:
  • RF radiation hazard
  • Fire hazard
  • Trapped personnel
Personnel are not normally permitted inside the chamber during a measurement as this not only can cause unwanted reflections from the human body but may also be aradiation hazard to the personnel concerned if tests are being performed at high RF powers. Such risks are from RF or non-ionizing radiation and not from the higher energyionizing radiation.
As RAM is highly absorptive of RF radiation, incident radiation will generate heat within the RAM. If this cannot be dissipated adequately there is a risk that hot spots may develop and the RAM temperature may rise to the point of combustion. This can be a risk if a transmitting antenna inadvertently gets too close to the RAM. Even for quite modest transmitting power levels, high gain antennas can concentrate the power sufficiently to cause high power flux near their apertures. Although recently manufactured RAM is normally treated with a fire retardant to reduce such risks, they are difficult to completely eliminate.
Safety regulations normally require the installation of a gaseous fire suppression system including smoke detectors. Gaseous fire suppression avoids damage caused by the extinguishing agent which would otherwise worsen damage caused by the fire itself. A common gaseous fire suppression agent is carbon dioxide. Normally the fire detection system is linked into the power supply to the chamber, so that the fire detection system can disconnect the power supply if smoke or a fire is detected.


See also

References

  1. ^ http://www.tcbmag.com/industriestrends/technology/104458p1.aspx
  2. ^ The Quietest Place on Earth – Orfield Labs [audiojunkies]
  3. ^ http://www.acoustics.salford.ac.uk/facilities/?content=anechoic
  4. ^ E Knott, J Shaeffer, M Tulley, Radar Cross Section. pp 528–531. ISBN 0-89006-618-3


External links



THANKS TO :
wikipedia