Created
January 20, 2021 21:24
-
-
Save controlpaths/c367144952bcd2663b848a32268ab9bf to your computer and use it in GitHub Desktop.
MATLAB script to check how image frequencies are generated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %% Image frequencies | |
| clear all | |
| close all | |
| clc | |
| nSamples = 10; | |
| f0 = 1; | |
| % Angle generate | |
| angle = linspace(0,2*pi,nSamples); | |
| % Compute image signals. Negative k valules generates 180 degrees images. | |
| k = 1; | |
| images = (f0+k*(nSamples-1)) % nSamples-1 because last point are repeated | |
| % high resolution angle generate for plot. | |
| angle_hires = linspace(0,2*pi,1000); | |
| % low frequency signal generate | |
| signal = sin(f0*angle); | |
| signal_hires = sin(angle_hires); | |
| % high frequency signal generate | |
| signal2 = sin(angle*images); | |
| signal2_hires = sin(angle_hires*images); | |
| % signal plotting | |
| figure | |
| plot(angle,signal, 'o'); | |
| hold on | |
| plot(angle_hires,signal_hires); | |
| plot(angle,signal2, 'o'); | |
| plot(angle_hires,signal2_hires); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment