“Manifesto of the new programmers of related specialties” or how I came to such a life

Today my article is thinking out loud from the man who stood in the way of programming almost by accident (although natural).

Yes, I understand that my experience is only my experience, but it seems to me that the well falls into the General trend. Moreover, the experiences described below, refers to the sphere of scientific activity, but you never know — it may be useful and out.

Source: https://xkcd.com/664/

In General, all these students from former student dedicated!

When in 2014 I finished a bachelor’s degree in “information and communication technologies and communication system” I knew almost nothing about the world of programming. Yes, I, like many, was in the first year subject called “computer science” — but that was in the first year! It’s been ages!

Overall, nothing particularly different from my undergraduate course, I did not expect, and doing for the master program “Communication and Signal Processing” of the German-Russian Institute of New Technologies.

But in vain…

We were only the second set, and the first has only collected the suitcases in the distant Germany (internship is six months in the second year of the course). In other words, no one from the inner circle has not faced seriously with the methods of European education, and ask about the details, there were not one.

We had a freshman, of course, different kinds of practices, which usually we were offered a democratic choice between writing scripts (primarily in the MATLAB language) and the use of various specialized GUI (in the sense that without scripting environments simulation).

Needless to say that we, the future Masters of Science, in my youthful stupidity, like the plague, avoided writing code. Now, he, for example, Simulink from the MathWorks: here they are blocks, that they regard, so they all kind of settings and switches.

So we thought…

One of the practical work of the first semester was the development of the receiver OFDM signal in the course “Methods for Modeling and Optimization”. The idea is very good: the technology and relevant to this day and are quite popular due to the use of, for example, in Wi-Fi networks and LTE/LTE-A (in OFDMA). The for masters to practice skills modeling of Telecom systems.

And on hand to give us a few options TK with obviously impractical parameters of the frame (so as not to look for a solution online), and we jumped on the already mentioned Simulink… And obtain the kettle actually on the head:


  • Each block conceals a lot of unknown parameters to change that impulsively — scary.
  • Manipulation of the numbers need to make, like, simple, but city still have God forbid.
  • Cathedral of the machine significantly slow down from the frenetic use of the GUI, even at the stage of surfing through the library of available blocks.
  • To finish something at home, you need to have the same Simulink. And no, in fact, alternatives.

Yes, the project eventually of course we finish, but I finished with a loud exhale of relief.

Some time passed and we came to the end of the first year master’s students. The number of home works using the GUI became to subside proportionally with the increase in the proportion of German subjects, although not yet reached the point of a paradigm shift. Many of us, including me, overcoming the considerable amplitude for the swing, more and more used in their scientific projects Matlab (albeit in the form of Toolbox’s) and not familiar, would seem to Simulink.

Point in our doubt was the phrase of one of the students in the second course (they just by the time he returned to Russia):


  • Forget, at least for the period of the internship, about Similink, MathCad, LabView and other — over the hill all written in the MATLAB language using MatLab itself or the free version Octave.

The statement was partly true: in Ilmenau dispute about the choice of tools, too, was not solved until the end. However, the choice was mostly between languages MATLAB, Python and C.

The same day I got a natural passion: and not to transfer any of its part of the model of the OFDM transmitter in script form? Just for fun.

And I started to work.


Instead of theoretical calculations I’ll just give a link to this excellent article from 2011 tgx and slides at the physical layer of the LTE Professor Michel-Thiel (TU Ilmenau). I think this will be enough.

“So, I repeat, what are we going to model?”
We will simulate the generator OFDM frame (OFDM frame generator).

What it will include:


  • the information symbols
  • pilot signals
  • zeros (DC)

From what (for the sake of simplicity) we obstreperous:


  • from the modeling of cyclic prefix (when knowledge of the basics, add on it will not be difficult)

The block diagram of the model. We will stay the block and inverse FFT (IFFT). The rest to complete the picture everyone can continue by yourself, I promised the teachers from the Department to leave something for the students.

Define for themselves a task:


  • a fixed number of sub-carriers (sub-carriers);
  • the fixed length frame;
  • we need to add one zero in the middle and a couple of zeros to the beginning and end of frame (total 5 pieces);
  • the information symbols are modulated using M-PSK or M-QAM, where M is order of modulation.

Start to code.


The entire script can be downloaded at the link.

Define input parameters:

clear all; close all; clc M = 4; % e.g. QPSK N_inf = 16; % number of subcarriers (information symbols, actually) in the frame
fr_len = 32; % the length of our OFDM frame
N_pil = fr_len - N_inf - 5; % number of pilots in the frame
pilots = [1; j; -1; -j]; % pilots (QPSK, in fact) nulls_idx = [1, 2, fr_len/2, fr_len-1, fr_len]; % indexes of nulls

Now, define the indices of the information symbols, by adopting the assumption that pilot signals must necessarily go before and/or after the zeros:

idx_1_start = 4;
idx_1_end = fr_len/2 - 2; idx_2_start = fr_len/2 + 2;
idx_2_end = fr_len - 3;

Then, the positions can be determined using the function linspace, bringing value to the lower of the nearest whole:

inf_idx_1 = (floor(linspace(idx_1_start, idx_1_end, N_inf/2))).'; inf_idx_2 = (floor(linspace(idx_2_start, idx_2_end, N_inf/2))).'; inf_ind = [inf_idx_1; inf_idx_2]; % simple concatenation

Add to this the indexes of the zeros and sort:

%concatenation and ascending sorting
inf_and_nulls_idx = union(inf_ind, nulls_idx); 

Accordingly, the indices of the pilot signals is everything else:

%numbers in range from 1 to frame length % that don't overlape with inf_and_nulls_idx vector
pilot_idx = setdiff(1:fr_len, inf_and_nulls_idx); 

Now let’s deal with pilot signals.

We have a template (the variable pilots), and, for example, we want our frame, pilots are inserted from the template sequence. To do this, of course, possible in the cycle. But can be a bit pomudrit matrix — good MATLAB allows you to do this with sufficient comfort.

First, determine how many patterns fit in the frame nicely:

pilots_len_psudo = floor(N_pil/length(pilots));

Next, form a vector, which consists of our patterns:

% linear algebra tricks:
mat_1 = pilots*ones(1, pilots_len_psudo); % rank-one matrix
resh = reshape(mat_1, pilots_len_psudo*length(pilots),1); % vectorization

And defined light vector, which only contains a piece of template — a “tail” that does not fit entirely in the frame:

tail_len = fr_len - N_inf - length(nulls_idx) ... - length(pilots)*pilots_len_psudo; tail = pilots(1:tail_len); % "tail" of the vector pilots

The received pilot symbols:

vec_pilots = [resh; tail]; % vector of completed pilots that frame consists

Go to the information symbols, namely generate a message and promodlive it:

message = randi([0 M-1], N_inf, 1); % decimal information symbols if M >= 16 info_symbols = qammod(message, M, pi/4);
else info_symbols = pskmod(message, M, pi/4);

You’re done! Assemble the frame:

%% Frame construction
frame = zeros(fr_len,1);
frame(pilot_idx) = vec_pilots;
frame(inf_ind) = info_symbols

It will look something like this:

frame = 0.00000 + 0.00000 i 0.00000 + 0.00000 i 1.00000 + 0.00000 i -0.70711 - 0.70711 i -0.70711 - 0.70711 i 0.70711 + 0.70711 i 0.00000 + 1.00000 i -0.70711 + 0.70711 i -0.70711 + 0.70711 i -1.00000 + 0.00000 i -0.70711 + 0.70711 i -0.70711 - 0.70711 i 0.00000 - 1.00000 i 0.70711 + 0.70711 i 1.00000 + 0.00000 i 0.00000 + 0.00000 i 0.00000 + 1.00000 i 0.70711 - 0.70711 i -0.70711 + 0.70711 i -1.00000 + 0.00000 i -0.70711 + 0.70711 i 0.70711 + 0.70711 i 0.00000 - 1.00000 i -0.70711 - 0.70711 i 0.70711 + 0.70711 i 1.00000 + 0.00000 i 0.70711 - 0.70711 i 0.00000 + 1.00000 i 0.70711 - 0.70711 i -1.00000 + 0.00000 i 0.00000 + 0.00000 i 0.00000 + 0.00000 i

“Buzz!” thought I quite and shut down the laptop. It took me all in all about a couple of hours, including writing code, learning some matlovsky functions and thinking through math tricks.



  • Writing code is nice and is like poetry!
  • Scripting is the easiest method of research for the field of Communication and Signal Processing.



  • It is not necessary to scorch from a gun on sparrows (if such a training goal, of course, not worth it): using Simulink, we undertook the solution of the simple fancy tool.
  • GUI is good, but to understand what is “under the hood” better.

And now, being already not a student, I want to say a fraternity the following:


  • Go for it!

Try to write code, even if initially it will be bad. With programming as with any other activity, Lehigh trouble — the beginning. And better to start early: if you are a scientist, or even a techie, sooner or later this skill you will need.


  • Required!

Ask the teachers and supervisors of advanced approaches and tools. If it is, of course, as some may…


  • Create!

Where else is better to recover all the sores to the newcomer as not part of the educational program? Be creative and hone their skills — again, the earlier you start, the better.

Novice programmers of all countries, unite!

In order to record their direct relationship to the student, make a memorable photo 2017 with two rectors: Peter Sharpham (right) and albert Kharisovich Gilmutdinov (left).


Cost to finish the program at least for these costumes! (just kidding)