Search This Blog

Wednesday, November 29, 2023

Boolean function

From Wikipedia, the free encyclopedia
A binary decision diagram and truth table of a ternary Boolean function

In mathematics, a Boolean function is a function whose arguments and result assume values from a two-element set (usually {true, false}, {0,1} or {-1,1}). Alternative names are switching function, used especially in older computer science literature, and truth function (or logical function), used in logic. Boolean functions are the subject of Boolean algebra and switching theory.

A Boolean function takes the form , where is known as the Boolean domain and is a non-negative integer called the arity of the function. In the case where , the function is a constant element of . A Boolean function with multiple outputs, with is a vectorial or vector-valued Boolean function (an S-box in symmetric cryptography).

There are different Boolean functions with arguments; equal to the number of different truth tables with entries.

Every -ary Boolean function can be expressed as a propositional formula in variables , and two propositional formulas are logically equivalent if and only if they express the same Boolean function.

Examples

Diagram displaying the sixteen binary Boolean functions
The sixteen binary Boolean functions

The rudimentary symmetric Boolean functions (logical connectives or logic gates) are:

An example of a more complicated function is the majority function (of an odd number of inputs).

Representation

A Boolean function represented as a Boolean circuit

A Boolean function may be specified in a variety of ways:

  • Truth table: explicitly listing its value for all possible values of the arguments
    • Marquand diagram: truth table values arranged in a two-dimensional grid (used in a Karnaugh map)
    • Binary decision diagram, listing the truth table values at the bottom of a binary tree
    • Venn diagram, depicting the truth table values as a colouring of regions of the plane

Algebraically, as a propositional formula using rudimentary Boolean functions:

Boolean formulas can also be displayed as a graph:

In order to optimize electronic circuits, Boolean formulas can be minimized using the Quine–McCluskey algorithm or Karnaugh map.

Analysis

Properties

A Boolean function can have a variety of properties:

  • Constant: Is always true or always false regardless of its arguments.
  • Monotone: for every combination of argument values, changing an argument from false to true can only cause the output to switch from false to true and not from true to false. A function is said to be unate in a certain variable if it is monotone with respect to changes in that variable.
  • Linear: for each variable, flipping the value of the variable either always makes a difference in the truth value or never makes a difference (a parity function).
  • Symmetric: the value does not depend on the order of its arguments.
  • Read-once: Can be expressed with conjunction, disjunction, and negation with a single instance of each variable.
  • Balanced: if its truth table contains an equal number of zeros and ones. The Hamming weight of the function is the number of ones in the truth table.
  • Bent: its derivatives are all balanced (the autocorrelation spectrum is zero)
  • Correlation immune to mth order: if the output is uncorrelated with all (linear) combinations of at most m arguments
  • Evasive: if evaluation of the function always requires the value of all arguments
  • A Boolean function is a Sheffer function if it can be used to create (by composition) any arbitrary Boolean function (see functional completeness)
  • The algebraic degree of a function is the order of the highest order monomial in its algebraic normal form

Circuit complexity attempts to classify Boolean functions with respect to the size or depth of circuits that can compute them.

Derived functions

A Boolean function may be decomposed using Boole's expansion theorem in positive and negative Shannon cofactors (Shannon expansion), which are the (k-1)-ary functions resulting from fixing one of the arguments (to zero or one). The general (k-ary) functions obtained by imposing a linear constraint on a set of inputs (a linear subspace) are known as subfunctions.

The Boolean derivative of the function to one of the arguments is a (k-1)-ary function that is true when the output of the function is sensitive to the chosen input variable; it is the XOR of the two corresponding cofactors. A derivative and a cofactor are used in a Reed–Muller expansion. The concept can be generalized as a k-ary derivative in the direction dx, obtained as the difference (XOR) of the function at x and x + dx.

The Möbius transform (or Boole-Möbius transform) of a Boolean function is the set of coefficients of its polynomial (algebraic normal form), as a function of the monomial exponent vectors. It is a self-inverse transform. It can be calculated efficiently using a butterfly algorithm ("Fast Möbius Transform"), analogous to the Fast Fourier Transform. Coincident Boolean functions are equal to their Möbius transform, i.e. their truth table (minterm) values equal their algebraic (monomial) coefficients. There are 2^2^(k−1) coincident functions of k arguments.

Cryptographic analysis

The Walsh transform of a Boolean function is a k-ary integer-valued function giving the coefficients of a decomposition into linear functions (Walsh functions), analogous to the decomposition of real-valued functions into harmonics by the Fourier transform. Its square is the power spectrum or Walsh spectrum. The Walsh coefficient of a single bit vector is a measure for the correlation of that bit with the output of the Boolean function. The maximum (in absolute value) Walsh coefficient is known as the linearity of the function. The highest number of bits (order) for which all Walsh coefficients are 0 (i.e. the subfunctions are balanced) is known as resiliency, and the function is said to be correlation immune to that order. The Walsh coefficients play a key role in linear cryptanalysis.

The autocorrelation of a Boolean function is a k-ary integer-valued function giving the correlation between a certain set of changes in the inputs and the function output. For a given bit vector it is related to the Hamming weight of the derivative in that direction. The maximal autocorrelation coefficient (in absolute value) is known as the absolute indicator. If all autocorrelation coefficients are 0 (i.e. the derivatives are balanced) for a certain number of bits then the function is said to satisfy the propagation criterion to that order; if they are all zero then the function is a bent function. The autocorrelation coefficients play a key role in differential cryptanalysis.

The Walsh coefficients of a Boolean function and its autocorrelation coefficients are related by the equivalent of the Wiener–Khinchin theorem, which states that the autocorrelation and the power spectrum are a Walsh transform pair.

Linear approximation table

These concepts can be extended naturally to vectorial Boolean functions by considering their output bits (coordinates) individually, or more thoroughly, by looking at the set of all linear functions of output bits, known as its components. The set of Walsh transforms of the components is known as a Linear Approximation Table (LAT) or correlation matrix; it describes the correlation between different linear combinations of input and output bits. The set of autocorrelation coefficients of the components is the autocorrelation table, related by a Walsh transform of the components to the more widely used Difference Distribution Table (DDT) which lists the correlations between differences in input and output bits (see also: S-box).

Real polynomial form

On the unit hypercube

Any Boolean function can be uniquely extended (interpolated) to the real domain by a multilinear polynomial in , constructed by summing the truth table values multiplied by indicator polynomials:

For example, the extension of the binary XOR function is
which equals
Some other examples are negation (), AND () and OR (). When all operands are independent (share no variables) a function's polynomial form can be found by repeatedly applying the polynomials of the operators in a Boolean formula. When the coefficients are calculated modulo 2 one obtains the algebraic normal form (Zhegalkin polynomial).

Direct expressions for the coefficients of the polynomial can be derived by taking an appropriate derivative:

this generalizes as the Möbius inversion of the partially ordered set of bit vectors:
where denotes the weight of the bit vector . Taken modulo 2, this is the Boolean Möbius transform, giving the algebraic normal form coefficients:
In both cases, the sum is taken over all bit-vectors a covered by m, i.e. the "one" bits of a form a subset of the one bits of m.

When the domain is restricted to the n-dimensional hypercube , the polynomial gives the probability of a positive outcome when the Boolean function f is applied to n independent random (Bernoulli) variables, with individual probabilities x. A special case of this fact is the piling-up lemma for parity functions. The polynomial form of a Boolean function can also be used as its natural extension to fuzzy logic.

On the symmetric hypercube

Often, the Boolean domain is taken as , with false ("0") mapping to 1 and true ("1") to -1 (see Analysis of Boolean functions). The polynomial corresponding to is then given by:

Using the symmetric Boolean domain simplifies certain aspects of the analysis, since negation corresponds to multiplying by -1 and linear functions are monomials (XOR is multiplication). This polynomial form thus corresponds to the Walsh transform (in this context also known as Fourier transform) of the function (see above). The polynomial also has the same statistical interpretation as the one in the standard Boolean domain, except that it now deals with the expected values (see piling-up lemma for an example).

Applications

Boolean functions play a basic role in questions of complexity theory as well as the design of processors for digital computers, where they are implemented in electronic circuits using logic gates.

The properties of Boolean functions are critical in cryptography, particularly in the design of symmetric key algorithms (see substitution box).

In cooperative game theory, monotone Boolean functions are called simple games (voting games); this notion is applied to solve problems in social choice theory.

Harmony

From Wikipedia, the free encyclopedia
https://en.wikipedia.org/wiki/Harmony
Barbershop quartets, such as this US Navy group, sing 4-part pieces, made up of a melody line (normally the lead) and 3 harmony parts.

In music, harmony is the concept of combining different sounds together in order to create new, distinct musical ideas. Theories of harmony seek to describe or explain the effects created by distinct pitches or tones coinciding with one another; harmonic objects such as chords, textures and tonalities are identified, defined, and categorized in the development of these theories. Harmony is broadly understood to involve both a "vertical" dimension (frequency-space) and a "horizontal" dimension (time-space), and often overlaps with related musical concepts such as melody, timbre, and form.

A particular emphasis on harmony is one of the core concepts underlying the theory and practice of Western music. The study of harmony involves the juxtaposition of individual pitches to create chords, and in turn the juxtaposition of chords to create larger chord progressions. The principles of connection that govern these structures have been the subject of centuries worth of theoretical work and vernacular practice alike.

Drawing both from music theoretical traditions and the field of psychoacoustics, its perception in large part consists of recognizing and processing consonance, a concept whose precise definition has varied throughout history, but is often associated with simple mathematical ratios between coincident pitch frequencies. In the physiological approach, consonance is viewed as a continuous variable measuring the human brain's ability to 'decode' aural sensory input. Culturally, consonant pitch relationships are often described as sounding more pleasant, euphonious, and beautiful than dissonant pitch relationships, which can be conversely characterized as unpleasant, discordant, or rough.

In popular and jazz harmony, chords are named by their root plus various terms and characters indicating their qualities. In many types of music, notably baroque, romantic, modern, and jazz, chords are often augmented with "tensions". A tension is an additional chord member that creates a relatively dissonant interval in relation to the bass. The notion of counterpoint seeks to understand and describe the relationships between melodic lines, often in the context of a polyphonic texture of several simultaneous but independent voices. Therefore, it is sometimes seen as a type of harmonic understanding, and sometimes distinguished from harmony.

Typically, in the classical common practice period a dissonant chord (chord with tension) "resolves" to a consonant chord. Harmonization usually sounds pleasant to the ear when there is a balance between consonance and dissonance. Simply put, this occurs when there is a balance between "tense" and "relaxed" moments. Dissonance is an important part of harmony when dissonance can be resolved and contribute to the composition of music as a whole. A misplayed note or any sound that is judged to detract from the whole composition can be described as disharmonious rather than dissonant.

Etymology and definitions

The term harmony derives from the Greek ἁρμονία harmonia, meaning "joint, agreement, concord", from the verb ἁρμόζω harmozō, "(Ι) fit together, join". Aristoxenus wrote a work entitled Elements of Harmony, which is thought the first work in European history written on the subject of harmony. In this book, Aristoxenus refers to previous experiments conducted by Pythagoreans to determine the relationship between small integer ratios and consonant notes (e.g., 1:2 describes an octave relationship, which is a doubling of frequency). While identifying as a Pythagorean, Aristoxenus claims that numerical ratios are not the ultimate determinant of harmony; instead, he claims that the listener's ear determines harmony.

Current dictionary definitions, while attempting to give concise descriptions, often highlight the ambiguity of the term in modern use. Ambiguities tend to arise from either aesthetic considerations (for example the view that only pleasing concords may be harmonious) or from the point of view of musical texture (distinguishing between harmonic (simultaneously sounding pitches) and "contrapuntal" (successively sounding tones)). According to A. Whittall:

While the entire history of music theory appears to depend on just such a distinction between harmony and counterpoint, it is no less evident that developments in the nature of musical composition down the centuries have presumed the interdependence – at times amounting to integration, at other times a source of sustained tension – between the vertical and horizontal dimensions of musical space.

The view that modern tonal harmony in Western music began in about 1600 is commonplace in music theory. This is usually accounted for by the replacement of horizontal (or contrapuntal) composition, common in the music of the Renaissance, with a new emphasis on the vertical element of composed music. Modern theorists, however, tend to see this as an unsatisfactory generalisation. According to Carl Dahlhaus:

It was not that counterpoint was supplanted by harmony (Bach's tonal counterpoint is surely no less polyphonic than Palestrina's modal writing) but that an older type both of counterpoint and of vertical technique was succeeded by a newer type. And harmony comprises not only the ("vertical") structure of chords but also their ("horizontal") movement. Like music as a whole, harmony is a process.

Descriptions and definitions of harmony and harmonic practice often show bias towards European (or Western) musical traditions, although many cultures practice vertical harmony. In addition, South Asian art music (Hindustani and Carnatic music) is frequently cited as placing little emphasis on what is perceived in western practice as conventional harmony; the underlying harmonic foundation for most South Asian music is the drone, a held open fifth interval (or fourth interval) that does not alter in pitch throughout the course of a composition. Pitch simultaneity in particular is rarely a major consideration. Nevertheless, many other considerations of pitch are relevant to the music, its theory and its structure, such as the complex system of Ragas, which combines both melodic and modal considerations and codifications within it.

So, intricate pitch combinations that sound simultaneously do occur in Indian classical music – but they are rarely studied as teleological harmonic or contrapuntal progressions – as with notated Western music. This contrasting emphasis (with regard to Indian music in particular) manifests itself in the different methods of performance adopted: in Indian Music, improvisation takes a major role in the structural framework of a piece, whereas in Western Music improvisation has been uncommon since the end of the 19th century. Where it does occur in Western music (or has in the past), the improvisation either embellishes pre-notated music or draws from musical models previously established in notated compositions, and therefore uses familiar harmonic schemes.

Emphasis on the precomposed in European art music and the written theory surrounding it shows considerable cultural bias. The Grove Dictionary of Music and Musicians (Oxford University Press) identifies this clearly:

In Western culture the musics that are most dependent on improvisation, such as jazz, have traditionally been regarded as inferior to art music, in which pre-composition is considered paramount. The conception of musics that live in oral traditions as something composed with the use of improvisatory techniques separates them from the higher-standing works that use notation.

Yet the evolution of harmonic practice and language itself, in Western art music, is and was facilitated by this process of prior composition, which permitted the study and analysis by theorists and composers of individual pre-constructed works in which pitches (and to some extent rhythms) remained unchanged regardless of the nature of the performance.

Historical rules

Early Western religious music often features parallel perfect intervals; these intervals would preserve the clarity of the original plainsong. These works were created and performed in cathedrals, and made use of the resonant modes of their respective cathedrals to create harmonies. As polyphony developed, however, the use of parallel intervals was slowly replaced by the English style of consonance that used thirds and sixths. The English style was considered to have a sweeter sound, and was better suited to polyphony in that it offered greater linear flexibility in part-writing.

Example of implied harmonies in J.S. Bach's Cello Suite no. 1 in G, BWV 1007, bars 1–2.

Types

Close position C major triad.
Open position C major triad.

Carl Dahlhaus (1990) distinguishes between coordinate and subordinate harmony. Subordinate harmony is the hierarchical tonality or tonal harmony well known today. Coordinate harmony is the older Medieval and Renaissance tonalité ancienne, "The term is meant to signify that sonorities are linked one after the other without giving rise to the impression of a goal-directed development. A first chord forms a 'progression' with a second chord, and a second with a third. But the former chord progression is independent of the later one and vice versa." Coordinate harmony follows direct (adjacent) relationships rather than indirect as in subordinate. Interval cycles create symmetrical harmonies, which have been extensively used by the composers Alban Berg, George Perle, Arnold Schoenberg, Béla Bartók, and Edgard Varèse's Density 21.5.

Close harmony and open harmony use close position and open position chords, respectively. See: Voicing (music) and Close and open harmony.

Other types of harmony are based upon the intervals of the chords used in that harmony. Most chords in western music are based on "tertian" harmony, or chords built with the interval of thirds. In the chord C Major7, C–E is a major third; E–G is a minor third; and G to B is a major third. Other types of harmony consist of quartal and quintal harmony.

A unison is considered a harmonic interval, just like a fifth or a third, but is unique in that it is two identical notes produced together. The unison, as a component of harmony, is important, especially in orchestration. In pop music, unison singing is usually called doubling, a technique The Beatles used in many of their earlier recordings. As a type of harmony, singing in unison or playing the same notes, often using different musical instruments, at the same time is commonly called monophonic harmonization.

Intervals

An interval is the relationship between two separate musical pitches. For example, in the melody "Twinkle Twinkle Little Star", between the first two notes (the first "twinkle") and the second two notes (the second "twinkle") is the interval of a fifth. What this means is that if the first two notes were the pitch C, the second two notes would be the pitch G—four scale notes, or seven chromatic notes (a perfect fifth), above it.

The following are common intervals:

Root Major third Minor third Fifth
C E E G
D F F A
D F F A
E G G B
E G G B
F A A C
F A A C
G B B D
A C C E
A C C E
B D D F
B D D F

When tuning notes using an equal temperament, such as the 12-tone equal temperament that has become ubiquitous in Western music, each interval is created using steps of the same size, producing harmonic relations marginally 'out of tune' from pure frequency ratios as explored by the ancient Greeks. 12-tone equal temperament evolved as a compromise from earlier systems where all intervals were calculated relative to a chosen root frequency, such as just intonation and well temperament. In those systems, a major third constructed up from C did not produce the same frequency as a minor third constructed up from D♭. Many keyboard and fretted instruments were constructed with the ability to play, for example, both of G♯ and A♭ without retuning. The notes of these pairs (even those where one lacks an accidental, such as E and F♭) were not the 'same' note in any sense.

Using the diatonic scale, constructing the major and minor keys with each of the 12 notes as the tonic can be achieved using only flats or sharps to spell notes within said key, never both. This is often visualized as traveling around the circle of fifths, with each step only involving a change in one note's accidental. As such, additional accidentals are free to convey more nuanced information in the context of a passage of music and the other notes that make it up. Even when working outside diatonic contexts, it is convention, if possible, to use each letter in the alphabet only once in describing a scale.

Importantly, a note spelled as F♭ conveys different harmonic information to the reader versus a note spelled as E. In a tuning system where two notes spelled differently are tuned to the same frequency, those notes are said to be enharmonic. Even if identical in isolation, different spellings of enharmonic notes provide meaningful context when reading and analyzing music. For example, even though E and F♭ are enharmonic, the former is considered to be a major third up from C, while F♭ is considered to be a diminished fourth up from C. In the context of a C major tonality, the former is the third of the scale, while the latter could (as one of numerous possible justifications) be serving the harmonic function of the third of a D♭ minor chord, a borrowed chord within the scale.

Therefore, the combination of notes with their specific intervals—a chord—creates harmony. For example, in a C chord, there are three notes: C, E, and G. The note C is the root. The notes E and G provide harmony, and in a G7 (G dominant 7th) chord, the root G with each subsequent note (in this case B, D and F) provide the harmony.

In the musical scale, there are twelve pitches. Each pitch is referred to as a "degree" of the scale. The names A, B, C, D, E, F, and G are insignificant. The intervals, however, are not. Here is an example:

C D E F G A B C
D E F G A B C D

As can be seen, no note will always be the same scale degree. The tonic, or first-degree note, can be any of the 12 notes (pitch classes) of the chromatic scale. All the other notes fall into place. For example, when C is the tonic, the fourth degree or subdominant is F. When D is the tonic, the fourth degree is G. While the note names remain constant, they may refer to different scale degrees, implying different intervals with respect to the tonic. The great power of this fact is that any musical work can be played or sung in any key. It is the same piece of music, as long as the intervals are the same—thus transposing the melody into the corresponding key. When the intervals surpass the perfect Octave (12 semitones), these intervals are called compound intervals, which include particularly the 9th, 11th, and 13th Intervals—widely used in jazz and blues Music.

Compound Intervals are formed and named as follows:

  • 2nd + Octave = 9th
  • 3rd + Octave = 10th
  • 4th + Octave = 11th
  • 5th + Octave = 12th
  • 6th + Octave = 13th
  • 7th + Octave = 14th

These numbers don't "add" together because intervals are numbered inclusive of the root note (e.g. one tone up is a 2nd), so the root is counted twice by adding them. Apart from this categorization, intervals can also be divided into consonant and dissonant. As explained in the following paragraphs, consonant intervals produce a sensation of relaxation and dissonant intervals a sensation of tension. In tonal music, the term consonant also means "brings resolution" (to some degree at least, whereas dissonance "requires resolution").

The consonant intervals are considered the perfect unison, octave, fifth, fourth and major and minor third and sixth, and their compound forms. An interval is referred to as "perfect" when the harmonic relationship is found in the natural overtone series (namely, the unison 1:1, octave 2:1, fifth 3:2, and fourth 4:3). The other basic intervals (second, third, sixth, and seventh) are called "imperfect" because the harmonic relationships are not found mathematically exact in the overtone series. In classical music the perfect fourth above the bass may be considered dissonant when its function is contrapuntal. Other intervals, the second and the seventh (and their compound forms) are considered Dissonant and require resolution (of the produced tension) and usually preparation (depending on the music style).

The effect of dissonance is perceived relatively within musical context: for example, a major seventh interval alone (i.e., C up to B) may be perceived as dissonant, but the same interval as part of a major seventh chord may sound relatively consonant. A tritone (the interval of the fourth step to the seventh step of the major scale, i.e., F to B) sounds very dissonant alone, but less so within the context of a dominant seventh chord (G7 or D7 in that example).

Chords and tension

In the Western tradition, in music after the seventeenth century, harmony is manipulated using chords, which are combinations of pitch classes. In tertian harmony, so named after the interval of a third, the members of chords are found and named by stacking intervals of the third, starting with the "root", then the "third" above the root, and the "fifth" above the root (which is a third above the third), etc. (Chord members are named after their interval above the root.) Dyads, the simplest chords, contain only two members (see power chords).

A chord with three members is called a triad because it has three members, not because it is necessarily built in thirds (see Quartal and quintal harmony for chords built with other intervals). Depending on the size of the intervals being stacked, different qualities of chords are formed. In popular and jazz harmony, chords are named by their root plus various terms and characters indicating their qualities. To keep the nomenclature as simple as possible, some defaults are accepted (not tabulated here). For example, the chord members C, E, and G, form a C Major triad, called by default simply a C chord. In an A chord (pronounced A-flat), the members are A, C, and E.

In many types of music, notably baroque, romantic, modern and jazz, chords are often augmented with "tensions". A tension is an additional chord member that creates a relatively dissonant interval in relation to the bass. Following the tertian practice of building chords by stacking thirds, the simplest first tension is added to a triad by stacking, on top of the existing root, third, and fifth, another third above the fifth, adding a new, potentially dissonant member a seventh away from the root (called the "seventh" of the chord) producing a four-note chord called a "seventh chord".

Depending on the widths of the individual thirds stacked to build the chord, the interval between the root and the seventh of the chord may be major, minor, or diminished. (The interval of an augmented seventh reproduces the root, and is therefore left out of the chordal nomenclature.) The nomenclature allows that, by default, "C7" indicates a chord with a root, third, fifth, and seventh spelled C, E, G, and B. Other types of seventh chords must be named more explicitly, such as "C Major 7" (spelled C, E, G, B), "C augmented 7" (here the word augmented applies to the fifth, not the seventh, spelled C, E, G, B), etc. (For a more complete exposition of nomenclature see Chord (music).)

Continuing to stack thirds on top of a seventh chord produces extensions, and brings in the "extended tensions" or "upper tensions" (those more than an octave above the root when stacked in thirds), the ninths, elevenths, and thirteenths. This creates the chords named after them. (Except for dyads and triads, tertian chord types are named for the interval of the largest size and magnitude in use in the stack, not for the number of chord members : thus a ninth chord has five members [tonic, 3rd, 5th, 7th, 9th], not nine.) Extensions beyond the thirteenth reproduce existing chord members and are (usually) left out of the nomenclature. Complex harmonies based on extended chords are found in abundance in jazz, late-romantic music, modern orchestral works, film music, etc.

Typically, in the classical Common practice period a dissonant chord (chord with tension) resolves to a consonant chord. Harmonization usually sounds pleasant to the ear when there is a balance between the consonant and dissonant sounds. In simple words, that occurs when there is a balance between "tense" and "relaxed" moments. For this reason, usually tension is 'prepared' and then 'resolved', where preparing tension means to place a series of consonant chords that lead smoothly to the dissonant chord. In this way the composer ensures introducing tension smoothly, without disturbing the listener. Once the piece reaches its sub-climax, the listener needs a moment of relaxation to clear up the tension, which is obtained by playing a consonant chord that resolves the tension of the previous chords. The clearing of this tension usually sounds pleasant to the listener, though this is not always the case in late-nineteenth century music, such as Tristan und Isolde by Richard Wagner.

Perception

The harmonious major triad is composed of three tones. Their frequency ratio corresponds approximately 6:5:4. In real performances, however, the third is often larger than 5:4. The ratio 5:4 corresponds to an interval of 386 cents, but an equally tempered major third is 400 cents and a Pythagorean third with a ratio of 81:64 is 408 cents. Measurements of frequencies in good performances confirm that the size of the major third varies across this range and can even lie outside it without sounding out of tune. Thus, there is no simple connection between frequency ratios and harmonic function.

A number of features contribute to the perception of a chord's harmony.

Tonal fusion

Tonal fusion contributes to the perceived consonance of a chord, describing the degree to which multiple pitches are heard as a single, unitary tone. Chords which have more coinciding partials (frequency components) are perceived as more consonant, such as the octave and perfect fifth. The spectra of these intervals resemble that of a uniform tone. According to this definition, a major triad fuses better than a minor triad and a major-minor seventh chord fuses better than a major-major seventh or minor-minor seventh. These differences may not be readily apparent in tempered contexts but can explain why major triads are generally more prevalent than minor triads and major-minor sevenths are generally more prevalent than other sevenths (in spite of the dissonance of the tritone interval) in mainstream tonal music.

In organ registers, certain harmonic interval combinations and chords are activated by a single key. The sounds produced fuse into one tone with a new timbre. This tonal fusion effect is also used in synthesizers and orchestral arrangements; for instance, in Ravel's Bolero #5 the parallel parts of flutes, horn and celesta resemble the sound of an electric organ.

Roughness

When adjacent harmonics in complex tones interfere with one another, they create the perception of what is known as "beating" or "roughness". These precepts are closely related to the perceived dissonance of chords. To interfere, partials must lie within a critical bandwidth, which is a measure of the ear's ability to separate different frequencies. Critical bandwidth lies between 2 and 3 semitones at high frequencies and becomes larger at lower frequencies. The roughest interval in the chromatic scale is the minor second and its inversion, the major seventh. For typical spectral envelopes in the central range, the second roughest interval is the major second and minor seventh, followed by the tritone, the minor third (major sixth), the major third (minor sixth) and the perfect fourth (fifth).

Familiarity

Familiarity also contributes to the perceived harmony of an interval. Chords that have often been heard in musical contexts tend to sound more consonant. This principle explains the gradual historical increase in harmonic complexity of Western music. For example, around 1600 unprepared seventh chords gradually became familiar and were therefore gradually perceived as more consonant.

Individual characteristics such as age and musical experience also have an effect on harmony perception.

Neural correlates of harmony

The inferior colliculus is a mid-brain structure which is the first site of binaural auditory integration, processing auditory information from the left and right ears. Frequency following responses (FFRs) recorded from the mid-brain exhibit peaks in activity which correspond to the frequency components of a tonal stimulus. The extent to which FFRs accurately represent the harmonic information of a chord is called neural salience, and this value is correlated with behavioral ratings of the perceived pleasantness of chords.

In response to harmonic intervals, cortical activity also distinguishes chords by their consonance, responding more robustly to chords with greater consonance.

Consonance and dissonance in balance

The creation and destruction of harmonic and 'statistical' tensions is essential to the maintenance of compositional drama. Any composition (or improvisation) which remains consistent and 'regular' throughout is, for me, equivalent to watching a movie with only 'good guys' in it, or eating cottage cheese.

— Frank Zappa, The Real Frank Zappa Book, page 181, Frank Zappa and Peter Occhiogrosso, 1990

Remote Desktop Services

From Wikipedia, the free encyclopedia

Remote Desktop Services (RDS), known as Terminal Services in Windows Server 2008 and earlier, is one of the components of Microsoft Windows that allow a user to initiate and control an interactive session on a remote computer or virtual machine over a network connection. RDS was first released in 1998 as Terminal Server in Windows NT 4.0 Terminal Server Edition, a stand-alone edition of Windows NT 4.0 Server that allowed users to log in remotely. Starting with Windows 2000, it was integrated under the name of Terminal Services as an optional component in the server editions of the Windows NT family of operating systems, receiving updates and improvements with each version of Windows. Terminal Services were then renamed to Remote Desktop Services with Windows Server 2008 R2 in 2009.

RDS is Microsoft's implementation of thin client architecture, where Windows software, and the entire desktop of the computer running RDS, are made accessible to any remote client machine that supports Remote Desktop Protocol (RDP). User interfaces are displayed from the server onto the client system and input from the client system is transmitted to the server - where software execution takes place. This is in contrast to application streaming systems, like Microsoft App-V, in which computer programs are streamed to the client on-demand and executed on the client machine.

RemoteFX was added to RDS as part of Windows Server 2008 R2 Service Pack 1.

Overview

Windows includes three client components that use RDS:

  1. Quick Assist (Windows 10 and later) and Windows Remote Assistance (Windows XP through Windows 8.1)
  2. Remote Desktop Connection (RDC)
  3. Fast user switching

The first two are individual utilities that allow a user to operate an interactive session on a remote computer over the network. In case of Remote Assistance, the remote user needs to receive an invitation and the control is cooperative. In case of RDC, however, the remote user opens a new session on the remote computer and has every power granted by its user account's rights and restrictions. Fast User Switching allows users to switch between user accounts on the local computer without quitting software and logging out. Fast User Switching is part of Winlogon and uses RDS to accomplish its switching feature. Third-party developers have also created client software for RDS. For example, rdesktop supports Unix platforms.

Although RDS is shipped with most editions of all versions of Windows NT since Windows 2000, its functionality differs in each version. Windows XP Home Edition does not accept any RDC connections at all, reserving RDS for Fast User Switching and Remote Assistance only. Other client versions of Windows only allow a maximum of one remote user to connect to the system at the cost of the user who has logged onto the console being disconnected. Windows Server allows two users to connect at the same time. This licensing scheme, called "Remote Desktop for Administration", facilitates administration of unattended or headless computers. Only by acquiring additional licenses (in addition to that of Windows) can a computer running Windows Server service multiple remote users at one time and achieve virtual desktop infrastructure.

For an organization, RDS allows the IT department to install applications on a central server instead of multiple computers. Remote users can log on and use those applications over the network. Such centralization can make maintenance and troubleshooting easier. RDS and Windows authentication systems prevent unauthorized users from accessing apps or data.

Microsoft has a long-standing agreement with Citrix to facilitate sharing of technologies and patent licensing between Microsoft Terminal Services and Citrix XenApp (formerly Citrix MetaFrame and Citrix Presentation Server). In this arrangement, Citrix has access to key source code for the Windows platform, enabling its developers to improve the security and performance of the Terminal Services platform. In late December 2004 the two companies announced a five-year renewal of this arrangement to cover Windows Vista.

Server components

The key server component of RDS is Terminal Server (termdd.sys), which listens on TCP port 3389. When a Remote Desktop Protocol (RDP) client connects to this port, it is tagged with a unique SessionID and associated with a freshly spawned console session (Session 0, keyboard, mouse and character mode UI only). The login subsystem (winlogon.exe) and the GDI graphics subsystem is then initiated, which handles the job of authenticating the user and presenting the GUI. These executables are loaded in a new session, rather than the console session. When creating the new session, the graphics and keyboard/mouse device drivers are replaced with RDP-specific drivers: RdpDD.sys and RdpWD.sys. The RdpDD.sys is the device driver and it captures the UI rendering calls into a format that is transmittable over RDP. RdpWD.sys acts as keyboard and mouse driver; it receives keyboard and mouse input over the TCP connection and presents them as keyboard or mouse inputs. It also allows creation of virtual channels, which allow other devices, such as disc, audio, printers, and COM ports to be redirected, i.e., the channels act as replacement for these devices. The channels connect to the client over the TCP connection; as the channels are accessed for data, the client is informed of the request, which is then transferred over the TCP connection to the application. This entire procedure is done by the terminal server and the client, with the RDP mediating the correct transfer, and is entirely transparent to the applications. RDP communications are encrypted using 128-bit RC4 encryption. Windows Server 2003 onwards, it can use a FIPS 140 compliant encryption schemes.

Once a client initiates a connection and is informed of a successful invocation of the terminal services stack at the server, it loads up the device as well as the keyboard/mouse drivers. The UI data received over RDP is decoded and rendered as UI, whereas the keyboard and mouse inputs to the Window hosting the UI is intercepted by the drivers, and transmitted over RDP to the server. It also creates the other virtual channels and sets up the redirection. RDP communication can be encrypted; using either low, medium or high encryption. With low encryption, user input (outgoing data) is encrypted using a weak (40-bit RC4) cipher. With medium encryption, UI packets (incoming data) are encrypted using this weak cipher as well. The setting "High encryption (Non-export)" uses 128-bit RC4 encryption and "High encryption (Export)" uses 40-bit RC4 encryption.

Terminal Server

Terminal Server is the server component of Terminal services. It handles the job of authenticating clients, as well as making the applications available remotely. It is also entrusted with the job of restricting the clients according to the level of access they have. The Terminal Server respects the configured software restriction policies, so as to restrict the availability of certain software to only a certain group of users. The remote session information is stored in specialized directories, called Session Directory which is stored at the server. Session directories are used to store state information about a session, and can be used to resume interrupted sessions. The terminal server also has to manage these directories. Terminal Servers can be used in a cluster as well.

In Windows Server 2008, it has been significantly overhauled. While logging in, if the user logged on to the local system using a Windows Server Domain account, the credentials from the same sign-on can be used to authenticate the remote session. However, this requires Windows Server 2008 to be the terminal server OS, while the client OS is limited to Windows Server 2008, Windows Vista and Windows 7. In addition, the terminal server may be configured to allow connection to individual programs, rather than the entire desktop, by means of a feature named RemoteApp. Terminal Services Web Access (TS Web Access) makes a RemoteApp session invocable from the web browser. It includes the TS Web Access Web Part control which maintains the list of RemoteApps deployed on the server and keeps the list up to date. Terminal Server can also integrate with Windows System Resource Manager to throttle resource usage of remote applications.

Terminal Server is managed by the Terminal Server Manager Microsoft Management Console snap-in. It can be used to configure the sign in requirements, as well as to enforce a single instance of remote session. It can also be configured by using Group Policy or Windows Management Instrumentation. It is, however, not available in client versions of Windows OS, where the server is pre-configured to allow only one session and enforce the rights of the user account on the remote session, without any customization.

Remote Desktop Gateway

The Remote Desktop Gateway service component, also known as RD Gateway, can tunnel the RDP session using a HTTPS channel. This increases the security of RDS by encapsulating the session with Transport Layer Security (TLS). This also allows the option to use Internet Explorer as the RDP client. The official MS RDP client for macOS supports RD Gateway as of version 8. This is also available for iOS and Android.

This feature was introduced in the Windows Server 2008 and Windows Home Server products.

In October 2021, Thincast, the main contributor of the FreeRDP project, published the first Remote Desktop Gateway solution running natively on Linux.

Remote Desktop HTML5 Web Client

In late 2018 Microsoft released the Remote Desktop HTML5 Web Client. The client allows users to connect to their remote apps or to their remote desktops without using an installed remote desktop client. The web client uses the TLS secured port 443 and does not use the RD Gateway to transport traffic, instead relying solely on the remote desktop session host aspect of remote desktop services.

Roles

Remote Desktop Gateway
Enables authorized users to connect to virtual desktops, Remote-App programs, and session-based desktops over a private network or the Internet.
Remote Desktop Connection Broker Role
Allows users to reconnect to their existing virtual desktop, RemoteApp programs, and session-based desktops. It enables even load distribution across RD Session Host servers in a session collection or across pooled virtual desktops in a pooled virtual desktop collection, and provides access to virtual desktops in a virtual desktop collection.
Remote Desktop Session Host
Enables a server to host RemoteApp programs as session-based desktops. Users can connect to RD Session Host servers in a session collection to run programs, save files, and use resources on those servers. Users can access Remote Desktop Session Host server by using the Remote Desktop Connection client or by using RemoteApp programs.
Remote Desktop Virtualization Host
Enables users to connect to virtual desktops by using RemoteApp and Desktop Connection.
Remote Desktop Web Access
Enables users to access RemoteApp and Desktop Connection through the Start Menu or through a web browser. RemoteApp and Desktop Connection provides users with a customized view of RemoteApp programs, session-based desktops, and virtual desktops.
Remote Desktop Licensing
Enables a server to manage RDS client access licenses (RDS CALs) that are required for each device or user to connect to a Remote Desktop Session Host server. RDS CALs are managed using the Remote Desktop Licensing Manager application.

RemoteApp

RemoteApp (or TS RemoteApp) is a special mode of RDS, available in Windows Server 2008 R2 and later, where remote session configuration is integrated into the client operating system. The RDP 6.1 client ships with Windows XP SP3, KB952155 for Windows XP SP2 users, Windows Vista SP1 and Windows Server 2008. The UI for the RemoteApp is rendered in a window over the local desktop, and is managed like any other window for local applications. The end result of this is that remote applications behave largely like local applications. The task of establishing the remote session, as well as redirecting local resources to the remote application, is transparent to the end user. Multiple applications can be started in a single RemoteApp session, each with their own windows.

A RemoteApp can be packaged either as a .rdp file or distributed via an .msi Windows Installer package. When packaged as an .rdp file (which contains the address of the RemoteApp server, authentication schemes to be used, and other settings), a RemoteApp can be launched by double clicking the file. It will invoke the Remote Desktop Connection client, which will connect to the server and render the UI. The RemoteApp can also be packaged in a Windows Installer database, installing which can register the RemoteApp in the Start menu as well as create shortcuts to launch it. A RemoteApp can also be registered as handler for file types or URIs. Opening a file registered with RemoteApp will first invoke Remote Desktop Connection, which will connect to the terminal server and then open the file. Any application which can be accessed over Remote Desktop can be served as a RemoteApp.

Windows 7 includes built-in support for RemoteApp publishing, but it has to be enabled manually in registry, since there is no RemoteApp management console in client versions of Microsoft Windows.

Windows Desktop Sharing

In Windows Vista onwards, Terminal Services also includes a multi-party desktop sharing capability known as Windows Desktop Sharing. Unlike Terminal Services, which creates a new user session for every RDP connection, Windows Desktop Sharing can host the remote session in the context of the currently logged in user without creating a new session, and make the Desktop, or a subset of it, available over RDP. Windows Desktop Sharing can be used to share the entire desktop, a specific region, or a particular application. Windows Desktop Sharing can also be used to share multi-monitor desktops. When sharing applications individually (rather than the entire desktop), the windows are managed (whether they are minimized or maximized) independently at the server and the client side.

The functionality is only provided via a public API, which can be used by any application to provide screen sharing functionality. Windows Desktop Sharing API exposes two objects: RDPSession for the sharing session and RDPViewer for the viewer. Multiple viewer objects can be instantiated for one Session object. A viewer can either be a passive viewer, who is just able to watch the application like a screencast, or an interactive viewer, who is able to interact in real time with the remote application. The RDPSession object contains all the shared applications, represented as Application objects, each with Window objects representing their on-screen windows. Per-application filters capture the application Windows and package them as Window objects. A viewer must authenticate itself before it can connect to a sharing session. This is done by generating an Invitation using the RDPSession. It contains an authentication ticket and password. The object is serialized and sent to the viewers, who need to present the Invitation when connecting.

Windows Desktop Sharing API is used by Windows Meeting Space and Windows Remote Assistance for providing application sharing functionality among network peers.

Client software

Remote Desktop Connection

Remote Desktop Connection client on macOS

Remote Desktop Connection (RDC, also called Remote Desktop or just RD, formerly known as Microsoft Terminal Services Client, mstsc or tsclient in Windows 2000 and prior) is the client application for RDS. It allows a user to remotely log into a networked computer running the terminal services server. RDC presents the desktop interface (or application GUI) of the remote system, as if it were accessed locally. In addition to regular username/password for authorizing for the remote session, RDC also supports using smart cards for authorization.

RDC 6.0 was released as part of Windows Vista. With RDC 6.0, the resolution of a remote session can be set independently of the settings at the remote computer. If the Desktop Experience component is plugged into the remote server, remote application user interface elements (e.g., application windows borders, Maximize, Minimize, and Close buttons etc.) will take on the same appearance of local applications. In this scenario, the remote applications will use the Aero theme if the user connects to the server from a Windows Vista machine running Aero. Later versions of the protocol also support rendering the UI in full 32-bit color, as well as resource redirection for printers, COM ports, disk drives, mice and keyboards. With resource redirection, remote applications can use the resources of the local computer. Audio is also redirected, so that any sounds generated by a remote application are played back at the client system. Moreover, a remote session can also span multiple monitors at the client system, independent of the multi-monitor settings at the server. RDC can also be used to connect to Windows Media Center (WMC) remote sessions; however, since WMC does not stream video using RDP, only the applications can be viewed this way, not any media.

RDC prioritizes UI data as well as keyboard and mouse inputs, as opposed to print jobs or file transfers. so as to make the applications more responsive. It redirects plug and play devices such as cameras, portable music players, and scanners, so that input from these devices can be used by the remote applications as well. RDC can also be used to connect to computers which are exposed via Windows Home Server RDP Gateway over the Internet. Finally, few shortcuts that will be handy

  • To achieve Ctrl+Alt+Del effect on remote desktop, you can use the Ctrl+Alt+End key combination.
  • To alternate between the full screen and window mode of remote desktop, you can use Ctrl+Alt+Break ( Ctrl+Fn+Alt+⇧ Shift on certain HP laptops).

Other clients

Microsoft produces an official client for a variety of non Windows platforms:

  • Windows Mobile
  • MacOS: Microsoft Remote Desktop for Mac
  • Android: Microsoft Remote Desktop
  • iOS and iPadOS: Microsoft Remote Desktop

There have been numerous non-Microsoft implementations of clients that implement subsets of the Microsoft functionality for a range of platforms. The most common are:

  • FreeRDP - Open Source under Apache license
  • rdesktop for Linux/Unix and Microsoft Windows
  • Remmina for Linux (based on FreeRDP)
  • CoRD for macOS (Discontinued in April 2020)
  • Thincast Client for Linux, macOS and Windows

Lie point symmetry

From Wikipedia, the free encyclopedia https://en.wikipedia.org/wiki/Lie_point_symmetry     ...