Sunday, 29 August 2010

Radio Mobile - Free Radio Planning Software

Radio wave propagation is a very complex process. It is impossible to precisely predict how waves will spread and what values we will measure at some particular point. Therefore we have some mathematical models to approximate radio propagation and to calculate field strength values according to predefined probability.

The propagation model, which is based on electromagnetic theory and on statistical analysis of both terrain features and radio measurements, predicts the median attenuation of the radio signal as a function of distance and the variability of the signal in time and in space. Propagation models define curves and formulas. With such model we can predict propagation in arbitrary distance from the transmitter.

Using curves and mathematical formulas manually is a very tough task. In order to automate and speed up such calculations many software tools were developed. Normally, radio planning software packages are used by broadcasters, mobile operators and radio frequency authorities. Because of complexity and small number of potential customers, the price of such software package can be pretty high. But there is one exception to this rule.

Radio Mobile is a software tool for radio propagation calculation. The author has decided to publish it under the "freeware" license which means that the software is freely available on the web. This software is primarily dedicated to amateur radio, however, it can be also used in other areas including broadcasting and professional mobile communications.

Calculations are based on the Longley-Rice propagation model. This is a general purpose radio propagation model for frequencies between 20 MHz and 20 Ghz. In order to use the software you also need terrain model data. This data is needed for calculations of effective heights which are needed to perform propagation calculations. You can find some terrain model data sources on the web. They offer free DTM (Digital Terrain Model) data which is enough to start working with the Radio Mobile.

Radio Mobile supports many fancy features like possibility to use DTM in various formats (DTED, SRTM), also in many layers with different resolution, possibility to add map pictures in raster format (BMP, JPEG, GIF, TIFF, PNG), possibility to calculate interference between radio stations and lots of functions to customize the view.


Basic way of use consists of entering radio stations with all parameters (if they are not entered yet) and calculation of the coverage. Here you have a lot of options to customize the calculation and view. Results can be saved for later use. It is also possible to define calculation step for coarse calculations to save some time.

For result display it is usually not enough to display it on the gray scale DTM. You would probably like to see it on some map. For this purpose you can use any map picture with known coordinates. The software allows you to enter coordinates for each picture in order to display it correctly over the DTM.

A very useful function is the calculation of interference between radio stations. You define protection ratio and minimum field strength for calculation and the software marks interference area with predefined color.

The software is also very useful for microwave link planning. It allows you to display terrain profile between two points, display of optical visibility from any point and calculation of link parameters. Although this software is free and dedicated for amateur radio it can be very useful tool for daily radio communication tasks.

Saturday, 28 August 2010

Digital Dividend - A Gap Between Digital Terrestrial Television and Miserable Failure

The first analog television broadcasts were made before World War II. Since late 1950s we have color television. Starting from 1980s there were many attempts to improve or extend analog television. All these experiments failed. The first real possibility for a significant advance in terrestrial television broadcasting came in 1990s when MPEG compression was successfully introduced into broadcast applications. And with first practical COFDM modulators the last major problem for digital broadcasting was solved.

The first attempts for digital terrestrial broadcasting were initiated because in some areas there was no free spectrum for new TV channels. Digital broadcasting allows us to use spectrum more efficiently since many TV channels and other services can share the same bandwidth which for analog television is used to broadcast only one TV channel. There is quite a lot of radio-frequency spectrum allocated for broadcast television. In Europe there are two frequency bands dedicated for this service: 174 MHz to 230 MHz in VHF band and 470 MHz to 862 MHz in UHF band. In 1961 there was a conference in Stockholm where individual frequency channels were assigned to each country. To avoid interference strict rules and procedures were defined and each country could only use those frequencies that are agreed by other countries. This had a practical consequence that on major transmitting sites only about 4 channels were available in UHF band and 1 in VHF band.

Many countries have come to the situation where expansion of terrestrial television was not possible because there were no free channels available. Digital terrestrial broadcasting was seen as a solution to this problem. First experiments were successful and many countries wanted to have some rules to extend the Stockholm 61 agreement. These rules were put into an agreement called Chester 97 named after the place where in 1997 a conference was held. This agreement defined additional rules for digital terrestrial broadcasting. But this agreement was only a temporary solution because with digital broadcasting it is possible to use spectrum more efficiently and it would be possible to make a brand new plan which will take into account different protection ratios between digital signals.

The "final" solution for new frequency plan for digital broadcasting was finalized at the Regional Radio Conference held in Geneva in 2006 (RRC-06). One of the outputs of this conference was a new digital frequency plan for digital broadcasting (GE06D). This plan replaces the old Stockholm plan (ST61) for analog television and provides a framework for detailed national planning. Because of digital broadcasting, different protection ratios and better tools to analyze possible interference it was possible to make a plan for 7 layers on UHF. Multiplying each layer with the number of TV channels in one multiplex we get quite a significant increase in total number of potentially available TV channels. At least in theory, this new plan should satisfy future broadcasting needs for at least for the next 20 years.

With DVB-T, MPEG-4 and statistical multiplexing you can easily accommodate 10 SDTV channels with decent quality in one multiplex. For HDTV this figure is about 3 to 5 channels, and with DVB-T2 you get an additional gain of up to 50% of capacity. But since the frequencies are now available and TV broadcasting is expanding, new TV services will come in soon future. Terrestrial broadcasting is still an important platform for TV distribution in many countries. This means that the capacity currently available for terrestrial broadcasting will be used also for HD services and many TV channels now available in SD will in the future migrate to HD. This means that the total number of TV channels available on the terrestrial platform will be slightly lower as it would be if only SDTV would be used. However, taking into account all the layers that were planned there would be no problem.

Unfortunately the reality differs from the theory. Immediately after the conference the European Commission got hit by an idea that, since the digital broadcasting is more spectrum-efficient, there should be some part of the spectrum which should be released after the digital switch-over. This part of the spectrum was called the "digital dividend". Of course, this idea was supported (and probably initiated) by the mobile industry. The appetite for some additional frequency spectrum for mobile services is enormous. But there is a problem. This consideration was not taken into account during the preparation of the new frequency plan or at the conference. There is no spectrum that will be released after digital switch-over. The same frequency bands in VHF and UHF that were available for analog television were now planned for digital television. With some compromises many countries were able to tightly squeeze 7 layers of coverage on the UHF band. This means that, at least in general, there is no gap, no possibility to add anything else into the UHF frequency band allocated to terrestrial television. Even changes to the existing plan would be very difficult.

So the Commission instructed technical bodies to investigate technical possibility to find a part of the UHF spectrum, currently allocated to terrestrial television, for possibility of implementing new services. These activities came to the proposal for using TV channels 61 to 69 (frequencies from 790 MHz to 862 MHz) for mobile services on a non-mandatory basis. This means that each country can decide whether it will use this band for broadcasting or for mobile services. In theory this sounds like a good compromise, but in practice this is a very bad solution with limited or no usability and a lot of problems.

All the countries participating at the RRC-06 put a lot of hard word and efforts to make a new digital plan. This plan is using all the available channels in the UHF band, from 21 to 69. This means that countries got their frequency rights also on channels from 61 to 69. Implementing mobile services would mean moving broadcasting out of this band. But moving where? There is no available spectrum for this since the whole UHF band for television was tightly planned for digital broadcasting. Implementing mobile services means simply to forget about broadcasting in this band. This, of course, means less capacity for broadcasting.

There are many aspects of the digital dividend approach.

  • The Stockholm 61 analog plan lasted for 45 years. All European countries put a lot of effort to make a new digital frequency plan. The Geneva 06 plan is a result of many years of hard work, negotiations and compromises. Immediately after the conference EC started the activities to destroy it.
  • The demand for broadcasting spectrum will grow. HDTV on the terrestrial platform is reality. Now there is more capacity for broadcasting as it was with analog television but not so much as it was initially assumed. Broadcasting is evolving and spectrum capacity for new services yet to be developed will be needed.
  • There is probably no country that would give up 72 MHz (9 TV channels) of broadcasting spectrum unless there is a very good and profitable reason. Currently the anticipated mobile services don't seem to be such reason.
  • The GE06 plan for digital broadcasting is built on the principle of equitable access to the spectrum. Releasing the digital dividend band will create inequitable access to the broadcasting spectrum since some countries will loose up to 20% of the rights in channels above 60.
  • Implementing new mobile services in this band is useless if this approach is not accepted with all countries. If one country decides to keep broadcasting in this band it will affect at least all neighboring countries.
  • Significant technical incompatibility between broadcasting and mobile services. There is huge difference in network topology and field strengths. Planned mobile services in the digital dividend band will cause interference to DVB-T reception. This may result in the inefficient use of spectrum.
  • Mobile services are never free. The mobile operator is always making profit. The existing models of providing mobile broadband are purely commercial. On the other hand, terrestrial broadcasting is free and is available to everybody. There is no country that has no free-to-air terrestrial broadcasting. Public service broadcasters strive to deliver high quality content to all segments of the population. They use money to make quality content and provide public services, and not the other way around. Digital terrestrial television shall remain a competitive platform. An attractive number of commercial and public services is always in the public interest.

A term 'dividend' denotes the monetary reward (payback) for your investment that you expect, and sometimes get, at the end of a business cycle. The digital dividend is similar - it is the payback for the investment in the digitization of television broadcasting. The investment in digital broadcasting is made partly by the broadcasters that have to change their transmitters but mostly by the viewers that have to change their receivers. So the broadcasters and viewers will pay for a change of technology that will free some spectrum for commercial mobile services. Who invests and who gets the dividend?

Friday, 27 August 2010

Turbo Pascal Download - How to Compile Old Projects

Turbo Pascal was probably the most widely used Pascal compiler of all times. Borland released it in early 1980s and at that time it was available on the CP/M and PC platform. It featured fast compiler, integrated development environment and a very affordable price. Its syntax, known also as Object Pascal, has become standard and the concept of units is still used in all modern implementations. Until recently Pascal programming language was taught in many schools. For many people it was the first step into computer programming. It is a language that is easy to write and easy to read so you need very few comments to understand what the program does.

Turbo Pascal in 1990s evolved into Delphi. This is a rapid application development tool for Windows. It still uses Object Pascal with many additional features. However, because of popularity in early years, there are many projects that were developed with Borland DOS compilers. If you would like to compile such project you would need the original compiler, most likely version 7.0 which was the last released DOS version. Unfortunately, this version is no longer available. Borland has some time ago released old versions of compilers free of charge: 1.0, 3.02 and 5.5. The last version 7.0 is not yet available.


If you would like to compile the old Pascal code you can either try to find the original compiler from one of the illegal sources or you can use the open-source Free Pascal in compatible mode. There is also a third option. You can use the TPC32 command line compiler which is available as part of the demo package of the TPC32 source files and can be downloaded for free. This is not some limited version, it is a fully functional compiler compatible with TPC.EXE command line compiler. It is called demo because the full version includes complete source files which are not available for free.

TPC32 is a successor of the TPC16, a compatible compiler written in Turbo Pascal 7. It is compatible with the original Borland compiler in all aspects. Compiles the same source files and generates binary compatible unit and executable files. TPC32 is still the same compiler, the sources were slightly modified to be compatible with Delphi 7 which doesn't use the old segment-offset memory model. TPC32 still generates 16-bit x86 code. Source code of both compilers is available for purchase. You can use this source code to understand the internal data structures and algorithms of the famous Borland product or to make your own compiler. Both compilers are also available in demo versions which include fully functional compiled executable files. Because TPC16 is a DOS application it has some memory limitations. The TPC32 is a Win32 application and uses flat memory model with very few limitations. Both compilers can be used to compile the old projects created with the original Borland tools.

Pascal programming language is now rarely used in schools, but for some programmers it is still very popular and many old projects are still maintained. TPC32 compiler might be a solution for those who need a cheap and legal solution to compile the old Pascal sources.

I'm a big fan of Pascal programming language. Therefore I have a lot of old projects created with Turbo/Borland Pascal. If you need a free compatible solution to compile the old Pascal projects you can download a demo version of the TPC32, Turbo Pascal compiler written in Delphi, which contains a fully functional command line compiler. You can also get the TPC32 source code. It can be used for your own project or as a great book on compiler design and implementation.

Thursday, 26 August 2010

FM Radio - Any Digital Alternative?

FM radio is a well known and used technology. It is used all around the world. There are some minor differences in modulation parameters and frequency bands but the basic principle is the same. It is amazing how popular this radio has become. FM radio receivers are found everywhere, even in mobile phones. In the last decade broadcasting has made a big step toward digital technologies. We are now in a phase of transition from analog television broadcasting to various forms of digital broadcasting. And television is far more complex than radio--simple stereo sound service. Why is there no suitable technology for digital radio?


The answer is pretty simple. We have to look at key aspects of the transition of television broadcasting. Analog television uses one frequency channel (from 6 to 8 MHz bandwidth ) for one program. Digital television broadcasting is using the same radio-frequency channel to broadcast multiplex--a digital package of many TV programs and other services. The advantage is obvious--using the same radio-frequency spectrum we can now broadcast many TV channels and other services. Therefore, digital television broadcasting means more efficient use of frequency spectrum. There is another very important aspect of digital TV broadcasting. Since both technologies are using radio-frequency channels with the same bandwidth it is possible to switch from analog to digital step by step. Such change from one technology to another usually takes years and needs detailed preparations on a large scale.

To switch from analog FM to digital broadcasting we need a suitable technology that will offer comparable quality, mobile reception, capacity for more radio stations, efficient use of radio spectrum, step by step transition and cheap receivers. There are many digital technologies that are already available for sound broadcasting. Unfortunately, none of those technologies is suitable for a direct replacement of existing analog broadcasting.

Currently there are already many efficient audio codecs that can be used with any digital technology. There are also digital transmission technologies suitable for digital sound broadcasting like T-DAB, DRM and DRM+. DVB-T and DVB-T2 in particular can also be used for radio. All those technologies can provide excellent quality and mobile reception. But this is not enough.

FM radio uses about 250 kHz wide channels. Channel spacing is 100 kHz in most parts of the world and 200 kHz in USA and some other countries. This combination of channel bandwidth and spacing makes it very difficult to simultaneously use analog and digital broadcasting. Therefore, the transition with existing technologies will be difficult. Some partial solutions like HD radio are nothing more than additional data and audio transmitted along main analog carrier.

There are probably only two possible approaches for the digitalization of FM band. Either to find a suitable technology that will satisfy all the above mentioned requirements or to select one technology that is future proof enough and make a totally new frequency plan for fast transition. Currently, the digitalization of frequencies used for FM radio will have to wait for a while.

Tuesday, 24 August 2010

Quarks, Big Bang and Large Hadron Collider (LHC)

People are curios. Curiosity is one of the key elements that drives humanity towards the answers about our existence and our future. Since ancient times people have asked themselves about the origins of everything. From universe to the basic elements of the matter. Some people many thousands years ago assumed that if you divide some piece of matter this division must come to an end. This process should end with the basic, indivisible elements that constitute matter--atoms.

In the last centuries many experiments have confirmed that the matter is indeed consisted of some small particles. Scientific approach has contributed to the discovery of various natural and synthetic substances, molecules, chemical elements and atoms. Atoms, once believed to be indivisible, were also found to have some hard nucleus with electrons orbiting around it. Then it was discovered that the atom nucleus is consisted of protons and neutrons. So the atoms are divisible. This fact had many consequences. One of them with the most notable effect is fission nuclear bomb. However, the division story didn't end there. Protons and neutrons were also found to contain some smaller particles--quarks.


Currently the list of all elementary particles is pretty long. This list is part of the Standard model--a model of how everything exists and interacts. It is believed that this model is not the final picture of the universe. There are still some unanswered questions. On the other hand, the universe itself is a subject of investigation. One of the key discoveries was that the universe is expanding. From this fact we can conclude that in the past the universe was smaller. The more we go into the past, the smaller it was. Sooner or later we come to the moment in time where the universe was infinitely small. This is called the Big Bang--the moment when the universe started to develop as we know it today, some 13.7 billion years ago. This is now the leading theory about the evolution of the universe. It is still unknown what banged, how and why.

The latest project to find some missing answers is the Large Hadron Collider (LHC) in CERN, Geneva. It is a giant ring 100 meters under ground where two beams of particles close to light speed will collide. Each collision will produce an enormous amount of other particles. Analysis of this debris will hopefully answer some questions about the nature of particles or even bring some new ones. Because of enormous collision energy (about 14 TeV) the circumstances will be close to the situation immediately after big bang. The LHC project is currently the largest and the most expensive scientific project.

Answering questions about micro and macro world will not only satisfy our curiosity but will also help us to understand the world. If we understand the world then we can make it better. And better world is a dream of everybody.

While doing science and searching for new particles it is a good idea to listen to good music like John Lennon Music. Either with the Beatles or as a solo musician, John Lennon proved that he knew what music is. Visit http://johnlennonmusic.net/ and learn about the music genius.

Monday, 23 August 2010

Home Recording Studio Software

There are many professional recording studios around. Famous names, soundproof rooms, fancy equipment and high prices. But you can build a decent recording studio at home. All you need is a suitable quiet place, a computer and recording studio software. The cost of the hardware and software can be as low as the price of a state of the art gaming computer!

To build a professional recording studio at home is not so hard. It is not the equipment that defines professionalism; it is your ambition and knowledge to achieve the goal. If you can afford to dedicate one room for studio purposes then all you need is some simple audio hardware, a computer and software.

The prices of computers can vary. Faster computers with better performances are preferred, but usually are tagged with higher prices. You can also select individual components and build a custom, not-so-expensive computer according to your needs.

You would expect that the most expensive piece of equipment is the recording studio software. Wrong! There are many professional software packages that are also used in professional recording studios and that don't cost a fortune. In fact, they are quite cheap. For a few hundred dollars you can get software with a lot of features, attractive and functional user interface and with functionality to convert any PC or Mac into a powerful recording studio.

There are also many recording software packages available. They all function in similar ways. Some of the most popular studio software packages are Propellerhead Reason, Pro Tools, Cubase, Nuendo, Sonar, and Digital Performer. All of these packages can be used in home recording studio. You need to compare them and check if they support features you are interested in. If you will not buy a new computer then you should check compatibility with the existing one - be careful because some software is only available for either PC or Mac platform.

Usually the first step when building a home recording studio is to define the purpose and to select audio equipment including sound card. The next step could be selecting the computer and software. However, in some cases these steps can be reversed. For example, you are astonished by the capabilities and user interface of the Propellerhead Reason software. In such case the software is already selected. You need a computer to run it, some audio card and probably a cheap MIDI keyboard for your first music experience.

One of the most popular recording studio software is Pro Tools. It is used in many professional studios. It is so popular because it comes (or works) with dedicated, high-quality audio hardware and really covers all tasks in audio recording, editing and mastering. There are three versions of Pro Tools available. Pro Tools HD is designed with the highest quality standards in mind and runs on a state-of-the-art DSP hardware. Pro Tools LE is a medium priced solution and works with many audio cards from Digidesign and M-Audio. And there is also a very cheap Pro Tools M-Powered that can be used with dozens of cheap M-Audio interfaces. The bottom line of all Pro Tools versions is that they all use the same file format. This means compatibility between your home recording studio and any professional studio using Pro Tools.


If you have decided to build a home recording studio you should first take a look at available software. Learn what is possible and start dreaming. Even with a modest computer and cheap software you can start recording or composing music. You will be amazed with all the possibilities you have at home. Soon you will be able to do things that few years ago were only possible in professional recording studios.

You can find more information about software used in recording studios at the Recording Studio Software website which is dedicated to recording studios, computers and software. Here you can read more about Macs, PCs, recording studio software selection, recording studio design, and you can also check supported features in recording studio software comparison table.

Sunday, 22 August 2010

Compiler Design - Hash Functions and Tables

The purpose of every compiler is to read the input file in one programming language and convert it to one or more output files. Output file can be a different programming language, object code or executable code. The process of compilation must first examine the input file. This means reading all characters, identifying keywords, expressions, statements and storing all the data into symbol tables for future use. Symbol table is one of the most important data structures in any compiler.

Symbol table stores identifiers and its attributes. Every time the compiler finds a new identifier in the source code it needs to check if this identifier is already in the table, and if not it needs to store it there. This means a lot of searches and comparisons with every symbol table item. Search is always a very time consuming operation. Our goal is to have a fast compiler. Therefore we should find a way to make the searches across the symbol table as fast as possible.

One of the simple yet effective approaches is to use some hash function and to create a hash table. For every identifier in the table we apply the hash function and calculate some number. The hash function is an arbitrary function that for each identifier returns some number. It can be a simple sum of the ASCII codes of the identifier or some more complex one. Then we use, for example, the last 4 bits of this hash value to determine where to search for our identifier. 4 bits of hash value mean that we have 16 different linked lists of identifiers. We search only the list that belongs to the calculated hash value. This means that we only have to search a small list of identifiers which have the same hash value. Using more bits of hash value and consequently having more linked lists means faster search but we need some more space for bigger hash table.


If we don't find our identifier in this list then we can be sure that the identifier is not in the table because all other identifiers have different hash values so they must be different. In such case we simply add the new identifier at the end of the list of identifiers which belongs to the calculated hash value. Using hash functions and hash tables is a very effective way to speed up searches in symbol tables. Hash functions and hash tables are used in almost all compilers because their implementation is pretty simple and the gain in search speed is huge.

There are many excellent books on compiler design. However, the best book on compiler design is the compiler itself. Take a look at Turbo Pascal compiler source code - a Turbo Pascal compiler written in Turbo Pascal. This source code shows all the beauty of the Pascal programming language and reveals all the tricks needed to build a fast and compact compiler for any language, not just Pascal.