<BLOCKQUOTE>Employs an adaptive whitening filter, using a simple LMS algorithm. The result is that resonant parts of a sound are removed.

</BLOCKQUOTE>

A brief overview is given for example in <AHREF="http://saba.kntu.ac.ir/eecd/taghirad/E%20books/TOC/Adaptive%20Filters.pdf"CLASS="ext"TARGET="_blank">saba.kntu.ac.ir/eecd/taghirad/E%20books/TOC/Adaptive%20Filters.pdf</A>. The module can be used in inverse mode, subtracting the whitened signal and thus retaining the resonant aspects of a sound.

Be careful with the feedback gain. Values above -50 dB can blow up the filter.

<BLOCKQUOTE>This works exactly as the normal _Convolution_ module, however it is capable of using arbitrary length impulse responses (larger than fit into the working memory), and using complex input (a combination of real and imaginary files such as output by the fourier translation module).

</BLOCKQUOTE>

The normal convolution module needs to load the impulse response completely into the RAM, which can take up a lot if you bear in mind that sample resolution is 32bit internal, that impulses can be multichannel and that for convolution the buffer needs to be twice the size of the IR. so for impulses with durations greater than 30 seconds or one minute, the module may break down with a out-of-memory exception. In this case, you can use the complex-convolution module which is performing a partitioned convolution.

You specify the amount of RAM in megabytes that you wish to dedicate to the process. Depending on this value and the size and number of channels of the input files, the amount of steps into which the process is split, is shown in the text field right to the "Mem.alloc" gadget. When the step size increases way beyond 32 or so, the process may take up a really long time, so try to increase memory in this case.

When you leave the imaginary inputs unchecked, you perform a normal (real) convolution. Note that in version 0.68 the cepstral options are hidden because they never really worked.

<BLOCKQUOTE>Convolution is the one of the fundamental algorithms in digital signal processing. It means to

filter a sound with a finite impulse response. Examples for filters include frequency equalization, reverb,

delays, creating an output that contains the spectral information common to both the input and

the impulse response.</BLOCKQUOTE>

This is arguably the most popular module of FScape, because convolution is very versatile, and you can easily create a variety of interesting sounds and textures.

## Parameters

_Input file:_ Sound to be filtered with an impulse response.

_Impulse response:_ Second sound file to be used as the "impulse response" for the FIR filtering. Naturally input file and impulse response can be exchanged while the output is the same. Use the shorter file for impulse response to make processing less RAM expensive. An impulse response can be a "normal" filter IR like a low pass, high pass etc. (something produced by the _FIR Designer_ module), the response from a delay or reverberation system or any other sound snippet. Convolution means the spectral characteristics of the IR (both amplitude spectrum and phase response) are superimposed onto the input file. When using normal sounds the output tends to emphasize the low frequencies unless the IR has a flat spectrum. It tends to emphasize the frequencies that exist both in the input and the IR and cancels those frequencies which are not present in either file. Every introductory text about DSP explains the details of convolution.

_Output file:_ Input convolved with IR.

_Mode:_ 'Convolution' for normal operation, i.e. the spectra are multiplied. In 'Deconvolution' mode the spectra are divided. Unless all frequencies are present in the IR you get a lot of boost at some (usually the high) frequencies. Also there's a problem with the overlap-control of the algorithm, so deconvolution hardly works (well, you can convolve a sound with another one, process it and try to deconvolve it again which should work). 'Conv w/ inversion' means the IR spectrum is modified in the way that the strongest frequencies become very weak and the weak frequencies become strong (phases not changed), sometimes works as a kind of deconvolution.

_Truncate overlaps:_ FScape technically convolves by STFT spectra multiplication and overlap-adding of successive frames. The truncated overlaps used to be a bug in an early version. Sometimes I liked the "buggy" results so now you can reintroduce that bug by checking this gadget...

_Normalize impulse energy:_ (This would be better placed in the 'Morphing' section.) It means each IR calculated in the morphing process is normalized so there's no change in the IR energy over time.

_File length:_ A normal non-circular convolution results in an output that is as long as the the sum of the input length and the impulse length (minus one sample). Often you want create an output file that has the same length as the input, then choose 'Input (no change)'. When FScape finds a Marker named 'Support' in the impulse file, then the first "support" samples of the convolution are omitted and then the remaining last samples; if not only samples at the end of the convolution are omitted. Choose 'without support' to skip the support of the IR. The 'Support' marker is written by the _FIR Designer_ module which generates symmetric sinc-filters; the strongest sample is the one in the middle and that's exactly the support, meaning that attacks in the input file remain on their position counting from the beginning of the file.

_Morphing:_ Means the IR file is split up into an integer number of equal length impulses.<br>By editing the envelope you can define which of these impulses is used for filtering at which moment in time (simplest case is a straight line from 0% to 100% over time meaning that the first IR is used at the beginning of the input file and the last one is used at the end).<br>The 'Policy' determines how the IRs are interpolated. 'Rect X-Fade' is normal linear interpolation. 'Polar X-Fade' tries to interpolate amplitudes and phases separately which sometimes gives more interesting results (mode not really worked out). 'Correlate and shift' doesn't work at the moment.<br>

The 'Window size' determines how long an interpolated IR stays valid. For fast movements you'll need a small window size to avoid clicks, for slow movements use bigger windows to increase processing speed. The 'Overlap' helps to avoid clicks.

<BLOCKQUOTE>A patch panel where you can place and connect simple filters for low/high/band-pass and

band-stop. The output is a finite impulse response file that can be used in the _Convolution_ module</BLOCKQUOTE>

There is a tab view to switch between a circuit building panel and a spectrum plot of the resulting filter. Filter units are created by double-clicking on the circuit panel. When a unit is selected, its parameters can be adjusted on the right hand side.

## Parameters

_File name:_ The FIR Designer creates an ordinary sound file that contains the impulse response of the particular filter. This sound file can be used as the IR in the _Convolution_ module. Since you normally won't listen to it, 32-bit floating point is usually the best choice for output resolution.

### Circuit panel

The desired filter is built up from elementary sinc-filters (brick wall high-pass/low-pass/band-pass/notch). You can assembly any number of those filters in series are parallel to create the desired frequency and phase response.<br>Double click on the panel to add a new basic filter. Double click left or right to an existing filter block the create a serial setting. Double click above or below an existing filter block to create a parallel setting. Very often you only need one filter block. Alt+Click will erase one block. The black line symbolizes the input/output wire. To change the type and settings of a filter block, just click on that block (it turns blue) and adjust the settings on the right (parameters 3 to 6).

_Type:_ Basic filter type. 'Allpass' means a flat spectrum (a unit impulse, possibly delayed and attenuated). 'Subtract' means that filter is subtracted from a unit impulse, therefore turning a low-pass into a high-pass etc. All filters are windowed sinc-filters as designed by the Kaiser method.

_Cutoff/Bandwidth:_ Margin from pass-band to stop-band. For band-passes and notches you also have a gadget for the bandwidth. In that case the cutoff is the middle frequency - e.g. if cutoff is 400 Hz and bandwidth is 200 Hz, the low frequency of the band-pass becomes 300 Hz and the upper frequency becomes 500 Hz. Cutoff becomes a geometric middle frequency (Sqrt(F_upper*F_lower)) when the bandwidth is given in semitones - e.g. if cutoff is 400 Hz and bandwidth is 12 semitones, the low frequency of the band-pass becomes 283 Hz and the upper frequency becomes 566 Hz. This is really awful and should be replaced by a direct parameter for lower/upper cutoff frequency.

_Roll-off_ can be specified for a cosine-modulated filter. Without roll-off, the filter will have brick wall characteristic.

_Gain/Delay:_ When building a circuit consisting of multiple elementary filter blocks these define the attenuation and delay of each block. You could, for example, place one allpass with zero delay and unity gain in parallel to an attenuated low-pass delayed by 1000 ms to create a tape style delay effect IR.

_Overtones:_ Following a stupid idea of myself. I wanted to create a filter that removes 50 Hz hum so I thought I'd build it up of a bunch of narrow band-passes tuned to 50 Hz, 100 Hz, 150 Hz etc. For band-passes and notches checking this gadget will cause the designer to generate multiple band-passes with the same settings but each spaced from the fundamental band-pass as given in 'Spacing' parameter until the "overtone" frequency reaches the 'Limit freq'. Well it works but don't expect to be able to remove hum with this.

_Filter length/window:_ In theory the sinc-filters are infinitely long. Therefore to realize them in a computer they have to be truncated at a reasonable number of taps. The higher the quality setting the longer the FIR will be resulting in shorter transition bands. Often, however, it is not desirable to have that narrow transition widths, so you might choose a low "quality" as well. Besides, the longer the filters gets, the more time smearing is produced by the filtering.<br>After truncation a window (an envelope rising from zero to maximum and ending again at zero) is applied to the filter. The windowing is a compromise between the amount of stop-band ripple that results from the truncation and the width of the transition band. Try out different windows and watch the result in the _Statistics_ module's spectrum view. Often Blackman is a good choice.

_Normalize gain:_ When checked the output file will have 0 dB peak. When not, the filter is just written "as is". That means the filter gain is untouched, so you can subtract for example a sound convolved with say a low pass filter from the wet signal and get exactly the high-pass signal. Often desirable when floating point output is written.

<BLOCKQUOTE>This module allows a translation from one time domain to frequency domain or vice versa. Once you transformed a sound to the Fourier domain you can apply all algorithms that you would normally apply to the time signal. Finally you can go back to the time domain.</BLOCKQUOTE>

Jean Joseph Baptiste Fourier became famous for his theorems known as the Fourier Analysis. In his model each signal (e.g. a sound) can be represented by a weighted sum of sines and cosines. The Fourier Analysis

(more precisely the discrete fourier transform) calculates those sine/cosine coefficients which

we call the fourier spectrum. The forward transform is paralleled by the possibility of a

lossless inverse transform (the synthesis).

## Parameters

_Input file:_ Time domain or frequency domain signal. Generally the Fourier

transform is defined for complex signals, i.e. those represented by complex numbers. Complex numbers are made

of a so-called real and a so-called imaginary part. Because ordinary sound file formats do not support complex

numbers, I decided to use separate files for real and imag parts. Usually you start from a real time signal

(deselect "imag" in the input) and do a forward transform resulting in the complex spectrum (check "imag" in

the output). Then you manipulate the spectrum (e.g. crop a portion) and translate it backward again (here

you supply both real and imag so you should check "imag" for the input) to get a time signal (often real so

deselect "imag" for output).

_Output:_ Time domain or frequency domain depending on the direction chosen.

Note that this module always assumes complex signals independent of the checkboxes. Therefore a "complete"

spectrum is calculated: It starts at 0 Hz (DC) and goes up to half the sampling rate (the Nyquist frequency,

for 44.1 kHz sounds this is equal to 22050 Hz) followed by descending negative frequencies until we finally

reach 0 Hz again.

_Direction:_ Forward for time input/ fourier output; backward for fourier input/ time output.

_Spectral format:_ Complex numbers can not only be represented by a sum of a real and an imag part (rect) but also as a 2D vector with a length and an angle. __Note:__ At the moment only the rect format is supported!

_FFT length:_ The discrete fourier transform is carried out via a speed

optimized algorithm called the fast fourier transform (FFT). In the most simple form it required the signal

vector to be of the size of a power of 2 (i.e. 2 samples, 4 samples, 8 samples, 16, 32, 64 etc.). If the input

sound's frame number is not a power of 2 you can choose to either truncate the sound to the next lower power of 2

or expand it by adding a certain amount of silence.

<BLOCKQUOTE>A Hilbert transformer takes an input signal and calculates two output signals that have a

constant 90 degrees phase difference across the whole spectrum. Applications are single sideband modulation (SSB)

also known as frequency shifting and envelope generation.

</BLOCKQUOTE>

## Parameters

_Input file:_ The file to transform

_Output file:_ The 90 degrees outputs can be thought of as the cosine and the sine part of the signal or as the real and imaginary part alternatively. When doing the pure transform

without modifications you'll get two output files. When performing frequency shifting or envelope generation

the output is real again (single file).

_Operation:_ What should be done after the hilbert transform. You can leave the signal unchanged, shift the spectrum up or down or calculate the sound's envelope.

_Anti-aliasing:_ When frequency shifting is applied we will normally want to

have a protection against aliasing. Aliasing occurs for example when you shift a signal downwards by 100 Hz and

the signal has significant energy below 100 Hz. Think of a partial at 30 Hz. When you downshift it by 100 Hz the

mathematical outcome is -70 Hz and physically you'll hear it at +70 Hz. By checking this gadget all signal content

that would generate aliasing is eliminated. There are applications where you want to have aliasing. For example

try to shift a signal up or down half the sampling rate (22050 Hz for a 44.1 kHz sound) - when you allow

aliasing the result will be an inverted spectrum! (1000 Hz becomes 21050 Hz, 2000 Hz becomes 20050 Hz etc.).<p>

Note that because of the anti-aliasing filter the bass frequencies are slightly attenuated. Try to feed this

module with white noise and see what comes out. If you don't like it apply a bass compensation filter afterward.

_Shift amount:_ The the "shift up" and "shift down" operation. Note that

frequency shifting is <B>not</B> pitch transposition. That means that harmonic relationships are destroyed

resulting in bell-like spectra with non-linear partial spacing, the kind of sound you know from ring

<BLOCKQUOTE>A technique that tries to imitate photo-mosaicing on the auditory level. Given a visual template of the desired sound (essentially a sonogram) and some input sounds, try to spread chunks of the input sound across the time-frequency plane of the template.

</BLOCKQUOTE>

This algorithm is inspired by the idea of Synthrumentation by Klarenz Barlow. It was developed for the piece "Achrostichon" dedicated to Folkmar Hein.

The template time-frequency plane is given by a black-and-white sonogram _Image input_ file. Frequency is considered logarithmically spaced! Small number of bands (e.g. 1 to 3 per octave) usually produce more interesting results than a literal sonogram. The sound material used to "paint" the template is given by the _Audio input_ field. Note that this file must be a magnitude longer than the target sound file's duration. If necessary, use a sound editor to concatenate the sound material to itself a couple of times to produce the necessary length.

The target duration is given by _Nominal duration_. It is called "nominal" because the actual duration may differ a little bit due to the randomization processes. The time resolution of the input image is automatically derived from the nominal duration, e.g. when the image has a width of 100 pixels and the nominal duration is 10 seconds, each pixel corresponds to 100 ms.

The frequency span of the input image is given by _Min freq._ and _Max freq._, the bands per octave are automatically derived from these settings and the input image's height.

If you take the photo-mosaic metaphor, the algorithm now reads in chunks from the input sound file as "photos" and places them on the time-frequency canvas. The overlapping in the time-frequency plane is specified by _Time Spacing_ and _Freq Spacing_ (where 100% means dense packing without overlap, 50% means 1x overlap etc.). To produce less regular rhythmic and harmonic output, use some _Time Jitter_ and _Freq Jitter_ which is a ratio of the time chunk length and frequency band coverage in percent, by which the "photo" maybe moved from the nominal position.

The smoothness of the "grains" or "photos" depends on the fade-in and fade-out of the chunks, as given by _Attack_ and _Release_.

White pixels in the input image constitute the loud parts, black pixels the silent parts. The corresponding minimum volume is given by the _Noise Floor_ parameter. The parameter _Max Boost_ specifies the maximum gain that can be applied to each "photo" to make it match the template pixel's volume.

Finally, if your input sound material has already been segmented, you can use markers to choose the photo-boundaries instead of the fixed-size time windows resulting from nominal duration divided by image-width. Each new marker in the input sound file marks the beginning of the next photo chunk. To use this approach, check the _Read Markers_ option.

<BLOCKQUOTE>The core of the original FScape version 0.1. It provides a patcher in which unit generators can be connected that operate on a FFT transformed slices of a sound.</BLOCKQUOTE>

Double click to open a popup window showing all available modules. You will have at least one _Analyze_ and one _Synthesize_ unit if you plan to start from a regular time domain sound file and go back to the time domain in the end.

Press+Drag a module to change its position. Alt+Press+Drag on a module to drag a connection line from source module to target module. Alt+Click on the connection line to delete the connection. Double click on the connection line to add a helper breakpoint. Double click on a module to open its settings dialog. Ctrl+Click or Right-click on a module to bring up a popup menu. The popup menu allows you to delete, rename, copy, paste and duplicate modules. Alias modules cannot be edited but always share their settings with its originators.

## Modules

Input+Output file read and write spectral data files, you cannot load or save sound files with them (use Analysis/Synthesis instead). You can load analysis files from SoundHack or save analysis files for later processing (e.g. using the Convert-Files module). I'm not sure if FScape will accept CSound analysis files?

Splitter and Unitor will split one input into several outputs and vice versa. Envelope will calculate the spectral envelope of its input. Contrast will emphasize strong partials. Cepstral calculates the cepstrum and high pass filters it, ideally removing the resonances, but I never got it working right. Zoom is nice and will just shrink the spectrum but taking out a specified portion, the output file will be shorter and pitched up just like in resampling. Shrink is similar but "resamples" the spectrum. Flip-Freq will work only with tonal sounds and not noise, it can alter the harmonic relationships by reversing bands and stretching/ shrinking them. Tarnish is very nice and works well with speech, it attenuates harmonics and thus kind of keeps the noisy parts. Convolve: convolution in frequency domain, which is multiplication in time domain, but not necessarily circular convolution. Mindmachine, I cannot remember what the exact algorithm is, but you can create nice spheric sounds. Smear will repeat STFT frames with a given attenuation. Extrapolate doesn't work(?). Percussion is nice: It captures the resonance of each spectral frame. Choose a very high frame size, like 65556 samples; then use the synthesized output sound file as a filter for convolution.

<BLOCKQUOTE>Transform from time domain to a multi-resolution sub-band decoding which is a mixed time-frequency 'scalogram'. Wavelets are small "packets" of signals that can be thought of as high- and low-pass

filters. A wavelet transform applies those filters recursively to a signal.</BLOCKQUOTE>

This module contains a pyramidal algorithm: The signal is high- and low-pass filtered and decimated (half of the samples are "thrown away"). Then the low-pass filtered signal is again put through the high/low-pass stage and so on until the size of the decimated sub-band signal is very small (the size of the filter kernel).

What you get is a multi-resolution sub-band coded version of the signal, a mixture of a time domain and a frequency domain representation. High frequency information has bad frequency resolution and good time resolution, low frequency information has a fine frequency resolution and a bad time resolution which somehow corresponds to our auditive perception system. Like the _Fourier Translation_ module, the transform is invertible. Unlike the fourier transform the signals are always real and not complex and the filter has compact support (i.e. the coefficients are localized in time while the fourier transform uses sinusoidal filters that have an infinite duration).

## Parameters

_Input and output file:_ Time domain or wavelet domain signal

depending on the direction chosen.

The output of the forward transform is that of a pyramid: We start with the few coefficients of the last

low-pass filter stage followed by the last high-pass filter. Next we find the high-pass coefficients of the

successive scales (going from sub-bands belonging to lower frequencies to those belonging to high frequencies).

Each successive sub-band is twice as long as its predecessor.

_Filter:_ Although an infinite number of filters (wavelets) exist you can

only choose between a few that are widely used and were introduced by Ingrid Daubechies. The number after the

name corresponds to the filter order (number of coefficients). The difference between the higher order filters

is very small while the Daub4 is most different from the others. Try to use different filters for forward and

backward transform! Unfortunately the module requests that the input file for a backward transform be of a

certain size (the exact size of a forward transform with the same filter). Be careful when you process the

forward transformed files because changing the length of the file may cause FScape to reject the file for

backward translation. This will be fixed in the next versions.

_Gain per Scale:_ Often the coefficients belong to low scales are much higher

than those belong to high scales. This can cause problems for integer output files because it will introduce

high quantization noise in the high scales. Try to tune this parameter so that the volume of the forward

transform output will remain approximately constant over the whole file (alternatively use floating point

files).

_Direction:_ Forward for time input/ fourier output; backward for fourier input/ time output.