diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/click-get.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/click-get.png new file mode 100644 index 0000000..4453b7d Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/click-get.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/getting-started-with-python.md b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/getting-started-with-python.md new file mode 100644 index 0000000..ce0137f --- /dev/null +++ b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/getting-started-with-python.md @@ -0,0 +1,98 @@ +# Getting Started with Python for DSP + +The goal of this preliminary tutorial is to get you set up with a functional Python environment. I will be starting with a fresh installation of Windows 10, but the steps should be similar, if not identical, if you are using Windows 11. If you are running macOS, please follow along as best as possible. Finally, if you are running Linux, depending on your distribution, you may have Python installed by default. + +Regardless of your system, if you run into any issues at all during the setup process, please reach out to Aidan Sharpe via email: + +[sharpe23@students.rowan.edu](mailto:sharpe23@students.rowan.edu?subject=DSP%20Help%20-%20FULL%20NAME) subject line: **DSP Help - FULL NAME**. + +## The Python Language +Recall your Computer Science & Programming and Introduction to Embedded Systems classes. You are familiar with C and C++, where by compiling a `.c` or `.cpp` file, you generate an executable `.exe` file. Both C and C++ are considered *compiled languages* for this reason. You can email the `.exe` file to a friend, and without any code (or even a compiler) they can run your file on their machine. When this file is executed, it runs in its own *process* on the operating system, which you can see by opening your task manager while the program is still running. + +Python is *not* a compiled language. Instead, it is what we call an interpreted language. Rather than creating an executable file, the code is run line-by-line by a program called an interpreter. In the next section, we will install the Python Interpreter. Importantly, since no executable file is created, anyone who wants to run your code will have to run it with their own Python Interpreter. Additionally, unlike a compiled language, the program does not have its own OS process. In the case of Python 3, your program will run in the `python` process. + +## Installing Python +Before we begin writing any code, we need to install the Python Interpreter. These installation instructions are, as noted prviously, targetted at Windows 10/11 users. If you happen to be running Linux, you probably already have a Python interpreter installed, especially if you are running a "just works" distribution such as Ubuntu or Fedora. If for whatever reason your Linux installation does not have Python, simply install it from your package manager. If you happen to be running macOS, please follow the installation instructions on [python.org](https://www.python.org/downloads/macos/). + +\newpage +### 1. Open the Microsoft Store +On you taskbar or "Start" menu, open the "Microsoft Store" application. + +![](open-microsoft-store.png) + +### 2. Search for "python 3.13" +In the Microsoft Store, search for "python 3.13" and click the result titled "Python 3.13". This is the interpreter and runtime we will be using. + +![](search-for-python-3.13.png) + +\newpage +### 4. Click "Get" +Click the "Get" button to install the application. Wait for the installation to complete. + +![](click-get.png) + +### 5. Verify installation +Open your "Start" menu and see if Python 3.13 and IDLE are shown. + +![](recently-installed.png) + +\newpage +## Hello World +Start by opening "Python 3.13". This is the *Python Interpreter* we mentioned earlier. When run directly as an application, we are met with the *Python Shell*. Here, we can type Python code, and it will be executed as we go. For example, we can write a one-line "Hello, World" style program simply by typing `print("Hello, World!")` and hitting the enter key. The text "Hello, World!" will be printed, and we are prompted again on the following line. We can change the text inside the quotes to whatever we want, and that text will be printed out as well. Congratulations, you have run your first Python code! + +![](hello-dsp.png) + +\newpage +## Basic Concepts - Variables, Functions, and Logic +You are likely used to declaring a variable in the following manner: +```c +int x; +``` +where you specify a data type and a variable name. In languages like C and C++, the variable $x$ will always be an integer within the scope that it was declared as one. This system of declaration is called *static typing*, which simply means that the data type of a variable---integer in this case---cannot change. Python is what is called a *dynamically typed* language, meaning that variables can change their data type at any time. For example, the following C code would generate an error +```c +int x = 5; +x = "hello"; +``` +but the following Python code would be valid: +```python +x = 5 +x = "hello" +``` +Two things should stand out when comparing the C and Python samples above. First, the Python code does not have semi-colons since statements in Python are terminated by a new line. Second, the Python code should stand out in that no type is explicitly stated. That is not to say that the variable does not have a type, but rather the type can change based on the value being stored. In the case of our example, $x$ is initially an integer, but then changed to a string. + +Rarely, do we see Python code standing alone outside a function like this, however. This is because functions allow us to re-use complex code segments. We create a function by using the `def` keyword, followed by the function name, a parameter list in parenthesis, and the line ends with a colon (:). The following line starts the body of the function, and it *must* be tabbed in once more than the line with the definition. + +**IMPORTANT:** In Python, changing the tabbing can change the behavior of the code, so be careful. Be patient, building the habit of paying attention to tabbing can take some time. + +Below is a simple function that adds two variables ($a$ and $b$) and returns the result. +```python +def add(a, b): + return a+b +``` + +The final basic concept is control logic. This will allow our program to make decisions based on the current program state. The simplest example is the `if`-`elif`-`else` statement. For example, if we wanted to find the maximum value between two variables $a$ and $b$ we might write the following: +```python +def max(a,b): + if a > b: + return a + else: + return b +``` +With this simple case, either $a$ is greater than $b$ and $a$ is the max, or $a$ is not greater than $b$ and $b$ is the max. It doesn't matter what we return if the two values are equal, because the result will be indistinguishable. + +Say we want to calculate our letter grade based on our number grade. We may write a function: +```python +def letter_grade(number_grade): + if number_grade >= 90: + return 'A' + elif number_grade >= 80: + return 'B' + elif number_grade >= 70: + return 'C' + elif number_grade >= 60: + return 'D' + else: + return 'F' +``` + +Here, we exhibit two new Python concepts: the `elif` keyword and "snake case". The `elif` keyword is Python's version of the `else if` you may be familiar with in other programming languages. Snake case (often stylized as snake_case) simply means all lower case with underscores between words. It is recommended that for Python code all variable and function names be written using snake_case as opposed to something like camelCase or PascalCase. According to PEP 8 - the style guide for Python, snake case is correct Python style. diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/getting-started-with-python.pdf b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/getting-started-with-python.pdf new file mode 100644 index 0000000..d433d2b Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/getting-started-with-python.pdf differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/hello-dsp.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/hello-dsp.png new file mode 100644 index 0000000..4146542 Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/hello-dsp.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/open-microsoft-store.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/open-microsoft-store.png new file mode 100644 index 0000000..80da356 Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/open-microsoft-store.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/recently-installed.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/recently-installed.png new file mode 100644 index 0000000..1eec211 Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/recently-installed.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/search-for-python-3.13.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/search-for-python-3.13.png new file mode 100644 index 0000000..244b7db Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/getting-started/search-for-python-3.13.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/adding-dunder.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/adding-dunder.png new file mode 100644 index 0000000..468213c Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/adding-dunder.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/creating-a-python-file.md b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/creating-a-python-file.md new file mode 100644 index 0000000..6010941 --- /dev/null +++ b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/creating-a-python-file.md @@ -0,0 +1,84 @@ +# Creating and Editing Python Files + +## Installing a Text Editor +A text editor is a type of program that (unsurprisingly) lets you edit text. Code is just text after all, so picking a good text editor is important to making writing code easier. There are plenty of good (and just as many bad) options available, so feel free to do some research. Personally, I use Vim and Neovim, which have a steep learning curve, but run really fast and allow for efficient edits. For the purposes of this exercise, however, I recommend Visual Studio Code (VS Code). + +To install VS Code, first open the Microsoft Store and search for visual studio code. Select the one called "Visual Studio Code". You should **not** install the Insiders edition or Visual Studio Community 2022. + +![](search-vs-code.png) + +\newpage +## Open VS Code +Open VS Code, and click File$\to$Open Folder. + +![](open-folder.png) + +Then, create and open a folder for your Python example files. This will be the folder we work in for all exercises. I recommend that you use a separate folder for your lab-related Python files, maybe even a separate folder for each lab. Once you click "Select Folder" you may get a pop-up asking you if you trust this folder. Its your folder, so you can trust it no problem. + +![](python-examples-folder.png) + +\newpage +## Creating Your First Python File +Hover over the "Explorer" panel, and click the "New File" button. Call the file "example1.py" or something similar. It is important to make sure the file ends with `.py`, so it is recognized as a Python file. +![](new-file.png) + +You should get a pop-up in the bottom right corner asking you if you want to install the Python extension. Go ahead and click the "Install" button to install the extension. This extension will add special tools to aid you in developing and running Python. Once it is done installing, close the tab, and switch to the tab for the Python file you previously created. + +![](python-extension.png) + +\newpage +## Writing a Python Program in a File +Copy the code from the image below to create a simple "hello world" program. This program defines the `main()` function that, when called, prints the text "Hello, world!" to the console. Then on line 5, we call the `main()` function. Once you are done copying, click the play button in the upper-right corner. The output from your code will show up in the terminal at the bottom of your screen. + +![](hello-file.png) + +\newpage +## The `import` Statement +Make a new file called "import_example.py" and copy the code from the image below. Again, click the play button to run your code. Notice that "Hello world!" was printed to the console even though we did not call the `main()` function directly from `import_example.py`. This was done because the `import` keyword both loads and runs the file being imported. + +![](hello-import.png) + +To fix this behavior, so we have to call the `main()` function explicitly from files that import `example1.py`, we can add the following code to our original file: + +![](adding-dunder.png) + +Please note that `__name__` and `"__main__"` have a double underscore before and after. These double underscore are special Python attributes called "dunder attributes". The `__name__` attribute is set by whichever file is doing the importing. In the example above, `import_example.py` was importing `example1.py`. When the file is run directly, the `__name__` attribute is set to `"__main__"`. In this way, we can actually create different behavior depending on whether or not the file is being run directly or being imported by another file. This can be a super helpful tool when debugging your code, so you will often see `if __name__ == "__main__":` in files that are meant to be executed directly. + +## Installing Libraries +For your labs, we will be using several libraries to make doing DSP-specific tasks easier and faster. These libraries are `numpy`, `scipy`, `matplotlib`, and `sympy`. To install them, we use `pip`---the package installer for Python. In the terminal at the bottom of your screen type the command: +```bash +pip install numpy scipy matlotlib sympy +``` +and hit the "enter" key to execute it. Wait for the packages to install, and you're done! + +![](install-libraries.png) + +If you get an error message saying that the `pip` command doesn't exist, try the command: +```bash +python -m pip install numpy scipy matplotlib sympy +``` + +\newpage +## Creating Your First Plot +To make a plot in Python, we will start by making a new file called `plot_example.py`. We will use two libraries to make our plot: `numpy` for array creation and manipulation and `matplotlib` for drawing the plot. To use the libraries, we import them. To make using the libraries easer, we can give them aliases. It is standard to use `np` as the alias for `numpy` and `plt` for `matplotlib.pyplot`. This reduces the amount of typing we have to do while writing the program without losing any meaning or clarity. To make an alias we use the `as` keyword as shown below: + +![](import-aliases.png) + +\newpage +Now that we can use the libraries in our code, we will actually make our plot. We start by defining our time (horizontal) axis as 100 evenly spaced points between -1 and 1 using the function `np.linspace(-1, 1, 100)`. I chose to plot a cosine, so we will need a frequency of oscillation. We can define our frequency with a variable and convert it to angular frequency and store that in another variable. The numpy library has special functions like `np.cos()` that return a new array containing the cosine of every element in the input array. We can then plot the signal-vs-time using the `plt.plot(horiz, vert)` function. This will create a line graph, but since we have 100 points, it will appear as a smooth curve. To actually show the graph, we need to call another function `plt.show()`. This function shows the current figure in a window, so we can see it. Copy the code shown below, and run it to see the plot. + +![](example-plot.png) + +## Sampling +In digital systems, we do not have access to continuous functions. Instead, we only have samples. To create a time axis that uses a set sampling period $T_s$ instead of a set number of points, we can use the `np.arange(lower_bound, upper_bound, T_s)` function. We typically use the `plt.stem()` function instead of the `plt.plot()` function to better show the individual samples. As an exercise, try to re-write the original example plot using the minimum sampling frequency that does not result in aliasing. Hint: what is the relationship between sampling frequency and sampling period? + +\newpage +## Closing +Now we have a text editor and all the libraries we will need for the course installed. We also learned how to create and run Python files, and how to use the `import` keyword. Finally, we learned a little bit about using the numpy and matplotlib libraries. For the official documentation for each of the libraries see the table below: + +| Library Name | Doc Website | +|--------------|-------------------------------------------------------| +| Numpy | [numpy.org](https://numpy.org/doc/stable/) | +| Scipy | [scipy.org](https://docs.scipy.org/doc/scipy/) | +| Matplotlib | [matlotlib.org](https://matplotlib.org/stable/) | +| Sympy | [sympy.org](https://docs.sympy.org/latest/index.html) | diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/creating-a-python-file.pdf b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/creating-a-python-file.pdf new file mode 100644 index 0000000..7e5da94 Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/creating-a-python-file.pdf differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/example-plot-code.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/example-plot-code.png new file mode 100644 index 0000000..8a9ec43 Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/example-plot-code.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/example-plot.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/example-plot.png new file mode 100644 index 0000000..9cada40 Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/example-plot.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/hello-file.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/hello-file.png new file mode 100644 index 0000000..22955ea Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/hello-file.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/hello-import.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/hello-import.png new file mode 100644 index 0000000..252b98d Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/hello-import.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/import-aliases.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/import-aliases.png new file mode 100644 index 0000000..1525e4f Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/import-aliases.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/install-libraries.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/install-libraries.png new file mode 100644 index 0000000..63b6358 Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/install-libraries.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/new-file.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/new-file.png new file mode 100644 index 0000000..a3b07e8 Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/new-file.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/open-folder.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/open-folder.png new file mode 100644 index 0000000..5e7873d Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/open-folder.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/python-examples-folder.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/python-examples-folder.png new file mode 100644 index 0000000..2d087bf Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/python-examples-folder.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/python-extension.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/python-extension.png new file mode 100644 index 0000000..8e63c9b Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/python-extension.png differ diff --git a/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/search-vs-code.png b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/search-vs-code.png new file mode 100644 index 0000000..6ad9b72 Binary files /dev/null and b/8th-Semester-Spring-2025/clinic-consultant/lecture-notes/python-files/search-vs-code.png differ diff --git a/Winter-2025/World-Regional-Geography/Essay-2.docx b/Winter-2025/World-Regional-Geography/Essay-2.docx new file mode 100644 index 0000000..9c6c054 Binary files /dev/null and b/Winter-2025/World-Regional-Geography/Essay-2.docx differ diff --git a/Winter-2025/World-Regional-Geography/Essay-2.md b/Winter-2025/World-Regional-Geography/Essay-2.md new file mode 100644 index 0000000..10054ea --- /dev/null +++ b/Winter-2025/World-Regional-Geography/Essay-2.md @@ -0,0 +1,9 @@ +# Globalization in Hawai'i - Aidan Sharpe + +Today, through international trade and the internet, we are more connected than ever before. Interconnectedness over vast distances is not a new idea, however. In pre-colonial Polynesia, the large region in the center of the Pacific ocean containing thousands of islands, exhibited traits of distant yet well-connected peoples. According to the textbook, "Polynesian culture, though spatially fragmented, exhibits a remarkable consistency and uniformity from one island to the next, from one end of this widely dispersed region to the other" (p. 493). The once British colony, now US state of Hawai'i is home to one of these ancient Polynesian cultures. However, even with recent preservation efforts, colonialism threatens the existence of these cultures to this day. + +Connectivity has allowed for increased economic growth in Polynesia by allowing it to establish strong relationships with the outside world. While not particularly rich in resources, Hawai'i has an abundance of natural beauty. According to the textbook, Hawai'i has traveled far along the path of bringing in money through tourism (p. 494). Another positive to come out of globalization is cultural preservation efforts. Apps like Duolingo, for example, have made it part of their mission to preserve endangered languages like Hawaiian. + +Despite the benefits of globalization, colonialism has done permanent damage to the Polynesian cultures. According to the textbook, "Polynesia has lost much of its ancient cultural consistency, and the region has become a patchwork of new and old—the new often bleak and barren, with the old under ever intensifying pressure" (p. 494). Additionally, Polynesia is geographically situated between two of the worlds most competitive superpowers, China and the United States. If war were to break out, it is likely that Polynesia would get caught in the crossfire. + +With rising tensions between the United States and China and with increasing preservation efforts, the fate of Polynesian culture is anyone's guess. Today, the Hawaiian language is considered "Critically Endangered" by the United Nations Educational, Scientific and Cultural Organization (UNESCO), but the number of speakers has been rising. Looking forward, hopefully US-China relations remain relatively peaceful, and preservation efforts continue.