diff --git a/src/.DS_Store b/src/.DS_Store index 5008ddf..14624d2 100644 Binary files a/src/.DS_Store and b/src/.DS_Store differ diff --git a/src/freqResponse.m b/src/freqResponse.m new file mode 100644 index 0000000..33d24a8 --- /dev/null +++ b/src/freqResponse.m @@ -0,0 +1,17 @@ +function output = freqResponse(input, H, fs) + + %midterm 1 function: + %H = @(w) (100*j*w*(1+j*w))/(10^(-7)*(1000+j*w)^2*(10+j*w)) + + len = length(input); + f = fs*(-len/2:len/2-1)/len; + + Input = fftshift(fft(input)); + + + Output = zeros(1, length(Input)); + for i=1:length(f) + Output(i) = Input(i) * H(f(i)); + end + output = real(ifft(Output)); +end \ No newline at end of file diff --git a/src/reverse.m b/src/reverse.m new file mode 100644 index 0000000..c14c8ae --- /dev/null +++ b/src/reverse.m @@ -0,0 +1,3 @@ +function output = reverse(input) + output = flip(input); +end \ No newline at end of file