viernes, 2 de noviembre de 2012

About: CAT - Conspiracy Against Truth and I Love CAT Music ®

Conspiracy Against Truth or CAT started in 2009 and evolved into an audiovisual collective comprising a live band, DJs, and visual artists.
The live band has played in many different places in Argentina, including the most well known night clubs and venues in Buenos Aires such as Niceto Club and The Roxy Buenos Aires.
Activities comprised within are music production and recording, visual art for live shows as well as Remixing other artists and DJing.





Other related blog entries:

Recording: Conspiracy Against Truth - Self Titled (2010) 
Live Performance: Conspiracy Against Truth - Garage Sessions (2012) 

Apart from being the co-founder, my roles are those of:
  • Music composer
  • Producer
  • Recording Engineer
  • Live guitars, vocals, synthesizers and controllers 
  • Live sound engineer and stage planner

Media

Photo credits:

http://www.facebook.com/LucasPagePH
http://www.facebook.com/pages/Antonella-Kippes-AK/167199633338949
http://www.facebook.com/gabrielmascolophotos













Live @ The Roxy BA

Live @ The Roxy BA

Live @ The Roxy BA


Live @ The Roxy BA


Live @ The Roxy BA


Live @ All Nylon BA

Live @ All Nylon BA

Live @ Niceto Club BA

Live @ Quilmes Beer Festival. Opening for Argentinean band Babasonicos.

Live @ The Roxy BA


I Love CAT Music

At present, the collective holds a monthly residency in Niceto Club, Buenos Aires (link), organizing the I Love CAT Music party. This event agglomerates different artists from the local scene, focusing mostly on electronic and rock music. Some artists that have played at the event include: Thomas Symmons, Dual Core DJs, Kevin Toro & Guido Lopardo, Flashbax, Kevin Di Serna and Fernando Ferreyra.

Photo credits:

http://www.facebook.com/cielo.barbierifotografia
http://www.facebook.com/pages/Antonella-Kippes-AK/167199633338949
http://www.facebook.com/gabrielmascolophotos




Flashbax @ I Love CAT Music

Conspiracy Against Truth @ I Love CAT Music

Flyer Announcing Fernando Ferreyra (Main) and Thomas Symmons (Warm Up)

I Love CAT Music Vol 1 @ Niceto Club BA

Conspiracy Against Truth @ I Love CAT Music BA

I Love CAT Music Vol 1 @ Niceto Club BA

I Love CAT Music Vol 1 @ Niceto Club BA

Flashbax @ I Love CAT Music



miércoles, 31 de octubre de 2012

Project: A Low Cost MIDI Fast Response Configurable Step Sequencer, design and implementation.

Place of Development: Faculty of Engineering - University of Buenos Aires/CAT Recording Studios
Date: June 2010
Duration: 4 weeks
Author: Pablo Manuel Delgado

References:

[1] MacKenzie, S. The 8051 Microcontroller, Third Edici on, Prentice Hall.
[2] Datasheets for: AT89S52, 81C55, Winstar Display WH1602C-B, MAX232C,
CD74HC244E.
[3] MIDI Implementation Standard

[4] Messick, Paul. Maximum MIDI: Advanced music applications in C++, Manning Publications.

Video Demonstration





The main goal of this project was to design, develop and implement a MIDI based real time event sequencer with an 8051 microcontroller.
This device has the capability of communicating with other external equipment which support this protocol and establishing a synchronized execution of the diverse events on different machines by doing so.
The most well known application of this kind of devices is the cyclic sequencing and synchronization of different electronic musical instruments at a determined pace. Other applications include lightning and special effects for a great variety of performances.
The market price of a professionally available product of these characteristics is relatively high, so that special care was taken in proposing an economically viable and efficient alternative to these complex industrial solutions, a task specially suited for low cost microcontrollers in the 8051 family. Additional functionality was added:
  • PC Device communication for sequence preloading.
  • Protocol parameter configurability
Project description

Introduction

The sequencer's main function is that of executing diverse rigid patterns of events by utilizing an 8, 16 or 32 step grid. These patterns are chained and modified in real time in order to conceive complex compositions. The sequence is generally displayed with some indicator in the step matrix (see figure below). The number of rows can vary and it generally represents a fixed musical note or percussive element, the final row quantity will determine the amount of events that can be triggered at the same time. Due to the cyclic nature of this process, this device is usually utilized on the generation of rhythmic patterns and periodic musical phrases.

Figure 1: Step sequencer operation


Communication with sequenced devices

One of the project's fundamental characteristics is that of inter-compatibility with different external agents to be operated. The device itself has not got any means of sound synthesis but acts as a mere event generator within the protocol standard. This communication is produced by using the micorcontroller's serial port with a software generated baud rate. 
The MIDI (Musical Instruments Digital Interface) communication protocol is widely used within the industry and is a standard for event intercommunication between computers, synthesizers, sound cards, lighting devices and effect units. Signals created comprise volume changes, vibrato and signal panning, clock synchronization and tempo. Due to the great variety of implementations available, it is common practice for these devices to include a MIDI implementation table exactly specifying how these parameters are handled and communicated in every particular case.

Figure 2: Device interconnection example.


Protocol's basic structure

The MIDI protocol consists on a start bit-stop bit serial interface communication for data transfer. It's baud rate is specified in 31250 symbols per second up to 1% of tolerance. Internally, MIDI comprises 16 channels (0 to 15) for media and control parameters multiplexing.
The basic structure used for the MIDI messages consists of 3 bytes. The first one being dedicated to system and channel messages (i.e. Channel 1, NOTE ON, Channel 3 NOTE OFF, hi of low nibble control type) and the second one containing the note number for the different octaves (coded onto 255 bytes). The third byte is dedicated to velocity and aftertouch for supporting devices. 
For example: a "Note ON" message on Channel 1 (0 Nibble), 0x3C note (C3 on the tempered scale) with an intensity (aftertouch value) of 0x34 would be:

0900H 003CH 0034H


Features and Configurability

The following features are foreseen for the project:

  • Text only LCD display and a multiple level menu for parameter configuration.
  • LED based current state indicator.
  • 4x8 keyboard with a logical state indicator for each button (on/off).
  • Configurable tempo from 60 to 200 Beats Per Minute.
  • Instrument type or MIDI note for each row.
  • Volume control (after-touch).
  • Serial port and USB port support for loading premade sequences from a personal computer.


Microcontroller choice and peripherals
Facing the diverse needs specified on the previous sections, a technical and market-related investigation was carried out in order to define which device would be the most suitable for this project and meet the most project requirements. The requirements, so to speak, were:
  • At least three independent timers to generate robust sequencing, MIDI baud rate and serial/usb communication baud rate synchronization. 
  • Enough ROM memory for code storing, definitions and equivalency tables for tempo, menu items and configurable variables.
  • Argentinean market availability and price.
  • Is situ parallel programming capability, due to simplicity and cost.
  • Great amount of available ports to handle the different ins and outs (keyboards, LED arrays, display, etc.).
The 89S52 microcontroller instantly met at least the first four requirements, whilst the last two were met by adding two hardware port expanders with extra ROM memory included.  
It must be noted that there is not a single optimal choice for the microcontrolling device. There are at least two other suitable architectures for this kind of task. Nevertheless, the 8051 architecture has a vast amount of documentation and market availability. Albeit a steeper learning/programming curve, the fact that its low level (assembler) programming is specially well suited for real time application optimization was enough to ensure an overall robustness in the products performance. Many commercially available MIDI implementations lack this robustness and user response, and that is undoubtedly a determinant factor on the final product's quality.
Tempo and execution rate calculation

BPM and instruction execution rate
The execution pace of a musical sequence or piece is defined in Beats Per Minute (BPM). In order to set a proper correspondence between the timer's hardware interrupt ratio assigned for the step sequence pace and the BPM value, a BPM conversion formula was derived:

\begin{equation}
\alpha = \frac{60 \times 1MHz.}{BPM \times \beta}
\end{equation}

$$\alpha$$ is the amount of interruptions that occur before the processor's core moves on to the next step on the sequence and
$$\beta$$ is the reload rate of the timer per interruption.
For better precision, a data fitted version of the Beta parameter curve was used to show the hyperbolic function variations (Figure 3). The black curve represents the "continuous" values while the white ones represent the values implemented on the ROM equivalence lookup table.

Figure 3: Timer 0 interruption rate vs time. Real curve and lookup table values.
Technical Specifications

  • Protocol: MIDI Standard v1.0 and RS-232/USB
  • Physical Interface: DIN5/180º connector, DB-9 Male Input
  • Power Supply: 7-9 V (5v regulated internally), 250mA
  • Display: 16 character alphanumeric x 2 
  • Keyboard: 4x8 push button matrix and LED binary indicator, Menu navigation, Play, Pause buttons
Block Diagram

A comprehensive block diagram is shown on  Figure 4.  The core of the project is comprised by the microcontroller and the port expanders. The arrows show the data flow direction from device to peripherals.

Figure 4: Block Diagram
Circuit

Schematic Diagram

Figures 5, 6 and 7 show the electrical connection schematics for the microcontroller's printed circuit board, the matrix keyboard, the LED array and the menu keyboard respectively.

In order to ameliorate bus noise immunity on the LCD, pull up resistors were used on each bus connection to make the high and low logical states (voltage levels) more reliable.
At first, serial resistors were calculated for the LED array implementation. The leds on the matrix are not actually on all the time, but they blink on and off at a very fast rate on each microcontroller cycle depending on their logical state. As a consequence of this mode of operation, these previously calculated serial resistors limited the amount of intermittent current that was necessary to give the LEDs a proper brightness, so they were omitted on the final stage of the design.
The MIDI interface was established by means of a current loop specified in the MIDI standard. An impedance matching buffer on the 89S52 serial output was used.

Figure 5: Microcontroller connection diagram.

Figure 6: Matrix keyboard and led connection diagram.

Figure 7: Menu navigation keyboard connection diagram.


PCB

Figures 8, 9 and 10 show a possible design of the printed circuit board. Experimental prototyping boards were used for the first design stages, with the exception of the matrix keyboard and LED, which designs were directly applied onto PCBs after a software schematic/layout matching test.

Figure 8: Main board PCB layout.

Figure 9: Matrix keyboard and LED array PCB layout.

Figure 10: Menu navigation keyboard PCB layout.
Memory Mapping

The external RAM memory mapping is comprised of the memory addresses offered by the 81C55 port expander IC's. Although the internal expander memory was not used in the end, a decision was made to include on the overall project memory design and addressing in case of a future firmware update/product expansion without any hardware modification.

Table 1: Internal Memory Mapping of the 81C55 port expanders.

Table 2: Internal Memory Space of the 81C55 port expanders.

Code Walkthrough

Initializations

The code consists of a series of initializations that can be divided onto three categories:

  • Port expanders
  • LCD display
  • Memory allocation for program variables
Port expanders:
The 81C55 port expanders need a proper initialization in order to be properly used. From the microcontroller's point of view, these are no other than external memory addresses. In turn, these expanders have 255 bytes of RAM memory, a timer, two input/output ports (8 bits) and a third 6 bit communication port. The initialization routine writes a "Command Register" byte that specifies the expander's mode of operation, including port functionality and timer.  This "command register" byte can be modified at any time of the main program execution. 
LCD Display:
A standard initialization routine proposed by the manufacturer is used. This routine is called twice in the code, in order to ensure that the proper values were set for the LCD display, this procedure was determined empirically. The routine's complexity was given by the proper access/write time management due to the fact that this device's frequency of operation orders of magnitude lower than the microcontroller's (270 KHz vs. 12 MHz.)
Variable Initialization:
This routine is just for setting preloaded variable values for the rest of the code. Some subroutines need some variables written on a specific physical address, as well as pre cleansing of memory allocation spaces to avoid garbage information to be permeated on some of the devices' initialization.
Main Routine

As both the sequence and the 89S52 input port comprises of 8 steps and pins respectively, it logically follows that each step (matrix column)  can be read directly from an input port pin. The matrix keyboard consists of 5 rows and 8 columns as well. The four first button rows correspond to the step sequencer and the last row is assigned to the menu navigation keyboard. 
First, the row to be read is addressed by putting a logical zero on the correspondent input pin. Next, the port corresponding to each column is read, a logical zero is assigned each time a button remains pressed. This byte is then complemented and stored into the RAM in an auxiliary array. This method is used because the keyboard is read twice in total, and a logical comparison between the first reading and the second one is performed. In case that the second reading matches the first one, it is considered that the button is on the correct state. This is made so to avoid incorrect state transitions due to the bouncing voltage effect on the push buttons.
Example of a contact's bouncing voltage measurement.
Source: http://mbed.org/users/4180_1/notebook/pushbuttons/

 The comparison is performed on an AND logical gate between the stored readings and the new ones. The state transition update is made by an XOR logical gate with the keyboard's values previously stored. This is made so because the push button logical state is held by software.
A difficult task to accomplish was that of having to read the push button twice with a minimum idle time (approx 10 ms to wait for the bouncing time transient) without having to stop the main routine, due to the real time constraints of the performance. This problem was solved by the use of flag bits and a decrementing auxiliary variable that changed its value each time the processor's core performs a full running cycle.

The algorithm for the push button interaction is described as follows:

  1. Read the button's current state. Set flag for the first reading. The first reading won't be repeated until this flag is set low again (first reading semaphore).
  2. Wait for the main program loop to decrement the auxiliary variable until it reaches the zero value. (this is equivalent to waiting a prudential time for the second reading)
  3. Read the keyboard matrix a second time. Set flag for the second reading. The second reading won't be repeated until this flag is set low again (first reading semaphore).
The reading flags are only set low again when the button is not pressed. This is a mean of avoiding swtiching the state of the push button while it is held pushed and the main loop is not interrupted.

Menu

The menu consists, broadly speaking, of two parts:
  • Parameter selection  to be modified.
  • Modification of the parameter itself.
 For the parameter selection, a cyclic counter is used. This counter is used as a menu pointer for all the different options to be displayed on the menu. When a parameter is changed, the aforementioned pointer is used to jump into the corresponding change routine. The AJMP instruction is utilized to give the compiler a certain freedom to manage these kind of jumps at the compiling stage. Furthermore, a relative code segment was to be defined in order to establish an INPAGE menu operation. This last step was implemented so to ensure the correct operation of the AJMP instruction.



Here is another video capture showing different parameter configurations via menu navigation. It is also shown how the real time communication with the PC works on loading pre-arranged patters from a file.










domingo, 21 de octubre de 2012

Project: A real time closed loop control system and target identification through Ethernet. Design and implementation.


Place of Development: École Nationale Supérieure d'Ingénieurs de Caen- France
Date: September 2012
Duration: 9 days
Author: Pablo Manuel Delgado et al. 

Further reading on J3eA , Volume 12 (2013) (French): http://www.j3ea.org/articles/j3ea/abs/2013/01/j3ea13011/j3ea13011.html

This intensive project took place on the laboratories of ENSICAEN's Signal, Control, Telecommunications and Embedded Systems specialization (SATE) and it comprised several phases distributed in nine full days of work.
The goal was to implement a closed loop control system on a direct current motor whose parameters were passed in real time through Ethernet, in a few longer than a week's time. A group of six people was assigned for this task.


 
The system specifications:

  • A real time control algorithm (and a prior system parameter identification) to be run on a PC, the processed data must be transmitted to a microcontroller through Ethernet, which in turn controls the current motor by a PWM output.
  • A human-machine graphical interface with all the necessary commands to run the control program.
  • The processing paradigm on the micro controller must be real time i.e. preemptive task scheduling. 

 Technological constraints:

  • The microcontroller (MCU) has to be a PIC32MX795F512L from Microchip, due to availability reasons.
  • The program was developed on IDE MPLAB with a C 32 toolchain.
  • The speed measurements are made with an ADC7634 Analog to Digital Converter from Analog Devices linked to the MCU through SPI in order to minimize the final PCB layout.
  • The control signal generation is made through a PWM module embedded in the microcontroller. Signal filtering is performed to adapt the controlled system's input requirements. The slow dynamics and noise immunity of the system allow such solution. 
  • The PC-MCU communication will be implemented on the TCP/IP protocol.
Technical Specifications:

PIC32MX795F512L
  • TQFP 100 pin package
  • Core working frequency: 80 MHz
  • Peripheral reference working frequency: 40 or 80MHz
  • Used peripherals set optimization




ADC AD7634
  • Sampling frequency: 2 KHz
  •  Bit depth: 18 bits
  • Input dynamic range: +/- 10 V (unipolar power supply)
  • SPI digital interface for configuration and data communication
  • Physical configuration of the ADC's parameters is possible


PWM Signal Conditioning Circuit
  • PWM switching frequency at 2KHz and a 3,3V peak to peak amplitude
  • Second order Low Pass Filter with a 200 Hz cutting frequency with unity gain on the passband. Its purpose is to reject the PWM signal's higher order harmonics.
  •  Adjustable gain for a correct utilization of the motor's control input dynamic range
 PC to MCU link
  • TCP/IP protocol. TCP and UDP connection options must be available due to different requierements on the system control parameters' reaction speed. 
  • Dynamic IP (DHCP) implementation to ensure greater portability and configuration.
 



Functional Diagram




Task Processing Diagram













domingo, 14 de octubre de 2012

Project: An Adaptive NLMS Algorithm for a MVDR Beamformer, design and performance analysis.

Place of Development: University of Buenos Aires - Faculty of Engineering
Date: November 2011
Author: Pablo Manuel Delgado


References:

[1] (Updated )Razia, S; Hossain, T; Matin, M A, "Performance analysis of adaptive beamforming algorithm for smart antenna system", IEEE International Conference on , Informatics, Electronics & Vision (ICIEV), 2012
[2]Kammoun, I.; Jaidane, M., "Exact performances analysis of a selective coefficient adaptive algorithm in acoustic echo cancellation", IEEE International Conference on coustics, Speech, and Signal Processing, 2001. Proceedings. (ICASSP '01). 2001
[3] S. Haykin, Adaptive Filter Theory, Third Edition, Ch. 5 and 9, Prentice Hall.
[4] L. Rey Vega, H. Rey, S. Tressens, J. Benesty. Adaptive Filtering: Algorithms and Analysis.

(MATLAB Testing Code soon to be available) 


A Normalized Least Mean Squares adaptive filter algorithm for an antenna array was implemented and analysed through simulation and real time performance for a QPSK modulated, 1 GHz carrier received test signal. The spatial filter response on the converging period was also determined and compared to that of the first steps of the iteration. A SNR, INR performance sensitivity analysis was also carried out through symbol interference and scattering diagrams.

Antennas (and antenna arrays) often operate in dynamic environments, where the signals (both desired and interfering) arrive from changing directions and with varying powers.
These antenna arrays employ an adaptive weighting algorithm, that adapts the weights based on the received signals to improve the performance of the array.
 
The project consisted in analysing incoming far field band limited signals to an array of antennas of arbitrary number.
The following preexisting conditions were taken into account for the design experiment:

  • The arbitrary number M of  antennas were separated at least at a half of the wavelength of the signal of interest, this is a direct consequence of the spatial sampling theorem.
  • The signal of interest impinges on the array at an angle of \( \theta_0 = \frac{\pi}{2} \) measured from the antennas' base plane (far field signal).
  • The environment noise is complex uncorrelated circular Gaussian with a power \(  \sigma^2_v \)
  • Moreover, other interfering signals impinge with a known measured angle of \( \theta_1 = \frac{2\pi}{3} \)  
  • It was also determined that there are other interfering signals as well, with unknown inference angles. 

The process of adaptive cancellation of the MVDR beamformer proved satisfactory for a known interfering signal angle. This way, initial parameters of the filter design can be identified for the adaptive algorithm initialization, based on the classical wiener beamforming filter. The adaptation process can be evidenced on the filter's spatial response function.
Ultimately, the cancelling and selectivity capability of a well designed filter improves with the number of iterations and with a good INR. 
If an unknown angle of an interfering signal is to be accounted for, the initial conditions cannot be determined clearly and the interfering signal results almost unmodified to the filter, impacting negatively on the symbol detection and received signal estimation.

(Details on the algorithm construction and theoretical background considerations soon to be added.)


Adaptation Scheme for an antennae array
Results and Performance analysis

A number of simulations in MATLAB were carried out as to test the filter performance facing varying factors such as environment noise, array size, INR and computational cost and convergence, i.e. number of iterations for a given resolution specification.

Spatial Response with known (estimated) interference signals

A spatial response was plotted for different antennae quantities and SNR, INR merit figures.
It can be seen that the number of iterations smooths the filter response. The number of antennae set the number of equally spaced zeros that can be detected on the first iterations. The simulation results show that the zeros corresponding to erroneous beamforming positions are smoothed out as the number of iteration increases. The more negative the signal to interference ratio i, the more pronounced these zeros are and the filter must reject interfering signals with more intensity.




Spatial response for n=6 iterations (above) and n = 990 (below). SNR = 10 INR = -10 M=10

Spatial response for n=6 iterations (above) and n = 990 (below). SNR = 10 INR = -5 M=10

Spatial response for n=6 iterations (above) and n = 990 (below). SNR = 10 INR = -1 M=10
Spatial response for n=6 iterations (above) and n = 990 (below). SNR = 20 INR = -5 M=10
Spatial response for n=6 iterations (above) and n = 990 (below). SNR = 20 INR = -5 M=6


Spatial response for n=6 iterations (above) and n = 990 (below). SNR = 20 INR = -10 M=6

Scattering Diagrams for a known interference signal

The scattering symbol diagrams for different array sizes, SNR and INR are shown below. It can be seen that, given that the beamforming filter is well applied the INR, i.e. the signal to interference ratio does not impact in a remarkable way on the filter's performance. Nevertheless, thermal noise has an important impact on the scattering of the received symbols. This is clearly due to the filters selectivity onto a single direction of preference, given by the constraint vector. White noise, on the contrary, impinges equally in all directions, giving a suboptimal approach. This concept will be clarified when the filter is utilized with an unknown received signal. 

Scattering Diagram for SNR = 10, INR = -10 and M = 10
Scattering Diagram for SNR = 10, INR = -5 and M = 10
Scattering Diagram for SNR = 10, INR = -1 and M = 10
Scattering Diagram for SNR = 20, INR = -5 and M = 10
Scattering Diagram for SNR = 20, INR = -5 and M =6



Interference of an unknown signal, unestimated angle of arrival.

Spatial Response

Simulations were carried out to show the filter's performance in the presence of an unknown interference signal.  It can be noted that, due to the absence of a zero on the real incidence angle of the interference signal (approx \( \frac{\pi}{4}\) ), the interfering signal is treated as white, uncorrelated noise. This is particularly notable on high interference signal power (i.e. low INR).

Spatial response for n=6 iterations (above) and n=990 (below). Unknown signal interference angle. SNR = 10, INR = -5, M = 10
Spatial response for n=6 iterations (above) and n=990 (below). Unknown signal interference angle. SNR = 30, INR = -10, M = 10


Scattering Diagrams

It can be seen that the incidence of thermal noise does not affect the filter performance on this case. Nevertheless, the fact that the interference signal angle of incidence is not known impacts negatively on the filter's performance regarding low INR. The filter's rejection power is highly compromised and the symbol detection becomes implausible.

Scattering Diagram for SNR=10 INR = -5 and M = 10. Angle of interfering signal is unknown.

Scattering Diagram for SNR=20 INR = -5 and M = 10. Angle of interfering signal is unknown.

Scattering Diagram for SNR=10 INR = -10 and M = 10. Angle of interfering signal is unknown.

Scattering Diagram for SNR=10 INR = -1 and M = 10. Angle of interfering signal is unknown.