function [output_noise] = addnoise(type, technology, material_type)

%Add noise dependent on sensor type, sensor technology, material type
%Noise is generated as a percentage of the sensor output
%User Note:  multiply this number by sensor output to get the noise

switch type
    case ('chemiresistor')
        switch technology
            case ('comp_polymer')
                switch material_type
                    case ('poly1a')
                        rms_noise = .0410;
                        output_noise  = randn(1)*rms_noise;
                    case ('poly2a')
                        rms_noise = .0930;
                        output_noise  = randn(1)*rms_noise;
                     case ('poly3a')
                        rms_noise = .0008;
                        output_noise  = randn(1)*rms_noise;
                     case ('poly6a')
                        rms_noise = .0486;
                        output_noise  = randn(1)*rms_noise;
                     case ('poly11a')
                        rms_noise = .0119;
                        output_noise  = randn(1)*rms_noise;
                     case ('poly13a')
                        rms_noise = .0298;
                        output_noise  = randn(1)*rms_noise;
                     case ('poly15a')
                        rms_noise = .0119;
                        output_noise  = randn(1)*rms_noise;
                    otherwise
                        rms_noise = .1;
                        output_noise  = randn(1)*rms_noise;
                end
            otherwise
                        rms_noise = 0;
                        output_noise  = randn(1)*rms_noise;               
            end
        otherwise            
        rms_noise = .1;
        output_noise  = randn(1)*rms_noise;
end
                
                
              