Synthesizer Examples
- example 1 -- The spectrogram is shown above using the parameters shown below.
The program: Matlab program.
The matlab program linked above was used to synthesize simulated calls similar to the natural song (which bird(s)?).
- The synthesized song is a FM-modulated, swept, sine wave.
- The range of frequencies,
shape of the sweep, and timing are controllable as shown in the code block below.
- Optionally, band-limited, white noise can be added. The noise band-pass can be set.
- The dominate frequency setting allows the user to amplify a band of frequencies as might happen in a resonant environment.
Parameters are set by modifying a block of statments in the program, shown below.
%=== parameters to modify =====================================
% Sample rate
Fs = 44100 ; %standard audio sampling rate
%song
%total_song_duration = 1 ;% seconds
number_sweeps = 10 ;
sweep_time = 0.2 ;%seconds
sweep_gap_start = 0.05 ;%seconds
sweep_gap_end = .3 ;%seconds
sweep_method = 'quadratic' ; %Can be 'linear','quadratic', or 'logarithmic'
begin_freq = 1400 ;% Hz
end_freq = 4600 ;% Hz
% additive noise to simulate wind, etc
noise_gain = 0.1 ;% filtered white noise; set to zero for no noise
noise_filter = 500 ;% Hz -- noise lowpass frequency
% do you want a 'dominate freq'?
% 0 means no; 1 means yes
use_dom_freq = 1 ;
dom_freq = 3000 ;%Hz
dom_peak_size = 3 ;% height of spectral bump
dom_peak_width = .05 ;% width of spectral bump 0.01 to 0.25
% do you want a WAV file?
% 0 means no; 1 means yes
write_file = 1;
% do you want computation?
% 0 means no; 1 means yes
compute_psd = 1 ;
compute_spectrogram = 1;
max_analysis_freq = 6000 ;% HZ
spectrogram_window_size = 1024 ; % more means better f resolution
% less means more time resolution; 1024 is good balance
spectrogram_colors = 'gray'; %can be 'jet', 'hot' 'gray' 'bone'
% 'autumn' 'spring' 'summer' 'copper' 'prism' 'cool'
% do you want to play song?
% 0 means no; 1 means yes
play_song = 1 ;
%=== end of parameters to modify ==============================
Code by Bruce Land
Electrical and Computer Engineering
Cornell University
This page transmitted using 100% recycled electrons.