%Psych 221
function [filter] = FilterTransferFxn
%Infrared Photography-Final Project
%Bill Peter
%Charles Chang-I Wang
close all
clear all
%This file plots spectral transfer function of modeled red filter

wavelength = [400e-9:1e-9:900e-9]
cutoff = 650e-9;
c = 3e8;

settle=0.3;
tau=-50/log(settle);
top=exp(-([650:1:900]-650)/tau);
top=-top*0.5+1;
bottom=exp(([400:1:650]-650)/tau);
bottom=bottom*0.5;
filter=[bottom top(2:length(top))];

plot(wavelength,filter,'linewidth',3)
title('Filter Transfer Function','fontsize',14)
xlabel('Wavelength','fontsize',14)
ylabel('Frequency Response (% of Light Transmitted)','fontsize',14)
grid on