added reverse function
This commit is contained in:
parent
0dd2fbb61b
commit
9fa884beae
BIN
src/.DS_Store
vendored
BIN
src/.DS_Store
vendored
Binary file not shown.
17
src/freqResponse.m
Normal file
17
src/freqResponse.m
Normal file
@ -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
|
3
src/reverse.m
Normal file
3
src/reverse.m
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
function output = reverse(input)
|
||||||
|
output = flip(input);
|
||||||
|
end
|
Reference in New Issue
Block a user