Characteristics of an Ideal Filter: LPF, HPF, BPF, and BRF

Manish Kumar Saini
Updated on 17-Dec-2021 07:01:09

26K+ Views

What is a Filter?A filter is a frequency selective network, i.e., it allows the transmission of signals of certain frequencies with no attenuation or with very little attenuation and it rejects all other frequency components.What is an Ideal Filter?An ideal filter is a frequency selective network that has very sharp cut-off characteristics, i.e., it transmits the signals of certain specified band of frequencies exactly and totally rejects the signals of frequencies outside this band. Therefore, the phase spectrum of an ideal filter is linear.Ideal Filter CharacteristicsBased on the frequency response characteristics, the ideal filters can be of following types −Ideal ... Read More

Properties of Hilbert Transform

Manish Kumar Saini
Updated on 17-Dec-2021 06:47:20

5K+ Views

Hilbert TransformWhen the phase angles of all the positive frequency spectral components of a signal are shifted by (-90°) and the phase angles of all the negative frequency spectral components are shifted by (+90°), then the resulting function of time is called the Hilbert transform of the signal.The Hilbert transform of a signal$\mathit{x\left(t\right)}$ is obtained by the convolution of $\mathit{x\left(t\right)}$ and (1/πt), i.e., , $$\mathrm{\mathit{\hat{x}\left(t\right)=x\left(t\right)*\left ( \frac{\mathrm{1}}{\mathit{\pi t}} \right )}}$$Properties of Hilbert TransformThe statement and proofs of the properties of the Hilbert transform are given as follows −Property 1The Hilbert transform does not change the domain of a signal.ProofLet a ... Read More

HTML5 Canvas Distorted

Chandu yadav
Updated on 16-Dec-2021 12:28:24

691 Views

If the canvas looks distorted, then try to change the height and width −The default height and width of the canvas in HTML5 is of 2/1 ratio −width = 300 height = 150ExampleLet us see an example −                    #mycanvas{border:1px solid red;}                         Output

Draw Lines Using HTML5 Canvas

Samual Sam
Updated on 16-Dec-2021 12:24:21

712 Views

The HTML5 tag is used to draw graphics, animations, etc. using scripting. It is a new tag introduced in HTML5. Use the lineTo() method to draw lines using HTML5 canvas.You can try to run the following code to learn how to draw lines using HTML5 Canvas Example           HTML5 Canvas Tag                              var c = document.getElementById('newCanvas');          var ctx = c.getContext('2d');          // Drawing lines          ctx.beginPath();          ctx.moveTo(30, 30);          ctx.lineTo(180, 100);          ctx.moveTo(30, 10);          ctx.lineTo(260, 100);          ctx.stroke();           Output

Draw an Oval in HTML5 Canvas

Arjun Thakur
Updated on 16-Dec-2021 12:13:41

948 Views

You can try to run the following code to draw an oval in HTML5 canvas −Example                                  // canvas          var c = document.getElementById('newCanvas');          var context = c.getContext('2d');          var cX = 0;          var cY = 0;          var radius = 40;                    context.save();          context.translate(c.width / 2, c.height / 2);          context.scale(2, 1);          context.beginPath();          context.arc(cX, cY, radius, 0, 2 * Math.PI, false);          context.restore();          context.fillStyle = '#000000';          context.fill();          context.lineWidth = 2;          context.strokeStyle = 'yellow';          context.stroke();           Output

Stop Copy, Paste and Backspace in Text Widget in Tkinter

Dev Prakash Sharma
Updated on 16-Dec-2021 11:19:01

715 Views

The Text widget accepts multiline user input, where you can type text and perform operations like copying, pasting, and deleting. There are certain ways to disable the shortcuts for various operations on a Text widget.In order to disable copy, paste and backspace in a Text widget, you’ve to bind the event with an event handler and return break using lambda keyword in python. The following example demonstrates how it works.Example# Import the required library from tkinter import * # Create an instance of tkinter frame or widget win=Tk() win.geometry("700x350") # Create a text widget text=Text(win, font="Calibri, 14") text.pack(fill= ... Read More

Get Index of Selected Option in Tkinter Combobox

Dev Prakash Sharma
Updated on 16-Dec-2021 11:15:20

11K+ Views

If you want to create a dropdown list of items and enable the items of list to be selected by the user, then you can use the Combobox widget. The Combobox widget allows you to create a dropdown list in which the list of items can be selected instantly. However, if you want to get the index of selected items in the combobox widget, then you can use the get() method. The get() method returns an integer of the selected item known as the index of the item.ExampleLet’s take an example to see how it works. In this example, we ... Read More

Get Entry Box Within a MessageBox in Tkinter

Dev Prakash Sharma
Updated on 16-Dec-2021 11:08:22

7K+ Views

There are various methods and built-in functions available with the messagebox library in tkinter. Let's assume you want to display a messagebox and take some input from the user in an Entry widget. In this case, you can use the askstring library from simpledialog. The askstring library creates a window that takes two arguments, the title of the window, and the input title before the Entry widget. Let's take an example to understand how it works.Example# Import the required library from tkinter import * from tkinter.simpledialog import askstring from tkinter.messagebox import showinfo # Create an instance of tkinter frame ... Read More

Attach Vertical Scrollbar to Treeview Using Tkinter

Dev Prakash Sharma
Updated on 16-Dec-2021 11:05:44

4K+ Views

If you want to display a list of items that contains some columns in it, then you can use the Treeview widget in Tkinter. The Treeview widget allows the user to add a large number of lists along with the properties that can be customized instantly.If you want to attach a vertical scrollbar to the list of items in a Treeview widget, then you can define a constructor of Scrollbar and configure it by adding the command to it. Let’s take an example and see how it works.Example# Import the required libraries from tkinter import * from tkinter import ttk ... Read More

Disable Multiselection on Treeview in Tkinter

Dev Prakash Sharma
Updated on 16-Dec-2021 11:04:14

2K+ Views

The Treeview widget is used to display a list of items with more than one feature in the form of columns. By default, the listed items in a Treeview widget can be selected multiple times, however you can disable this feature by using selectmode="browse" in the Treeview widget constructor. The Treeview widget can be implemented by using the Treeview(root, column, **options) constructor.ExampleThe following example demonstrates how to disable multiselection in a Treeview widget.# Import the required libraries from tkinter import * from tkinter import ttk # Create an instance of tkinter frame win=Tk() # Set the size of ... Read More

Advertisements