% 
% compression_eg.m
% example call of DAFX compexp function + plot

close all;
clear all;

filename='acoustic.wav';


% read the sample waveform
[x,Fs,bits] = wavread(filename);

comp = -0.5; %set compressor
a = 0.5;

y = compexp(x,comp,a,Fs);
    
% write output
wavwrite(y,Fs,bits,'out_compression.wav');


figure(1);


hold on
plot(y,'r');
plot(x,'b');

title('Compressed and Boosted Signal');